Created
July 15, 2020 22:51
-
-
Save idling-mind/12ac462d9076f90675805502e0f08ffd to your computer and use it in GitHub Desktop.
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
import pandas as pd | |
# Convert the list of dict into a dataframe. | |
df = pd.DataFrame(items) | |
# Taking the column mediaMetadata and splitting it into individual columns | |
dfmeta = df.mediaMetadata.apply(pd.Series) | |
# Combining all the different columns into one final dataframe | |
photos = pd.concat( | |
[ | |
df.drop('mediaMetadata', axis=1), | |
dfmeta.drop('photo', axis=1), | |
dfmeta.photo.apply(pd.Series) | |
], axis=1 | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment