Created
November 9, 2021 02:39
-
-
Save ivanvoid/e7447f295cc39090629839011c6fb22b to your computer and use it in GitHub Desktop.
dict to dataframe
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# transform data from dict to dataframe | |
import pandas as pd | |
from tqdm import tqdm | |
data = pd.DataFrame(columns=['category', 'name']) | |
for category in tqdm(all_categories): | |
names = category_lines[category] | |
for name in names: | |
frame = {'category':category, 'name':name} | |
data = data.append(frame, ignore_index=True) | |
data |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment