Created
November 14, 2021 23:47
-
-
Save billmetangmo/09b3c2e24a1a579d14e1ea9269467e3b to your computer and use it in GitHub Desktop.
Read a file with one json per line with pandas
This file contains hidden or 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 | |
| df = pf.read_json("chemin",lines=True) | |
| df.columns.values | |
| df["Useridentity"] # contient du json imbriqué | |
| df["Useridentity"].apply(df.Series) | |
| df["Useridentity"].apply(df.Series).columns.values # ce df a les jsons imbriqués comme colonnes | |
| fdf = df[df["Useridentity"].apply(df.Series)["arn"].isna()] # récupéer le df avec tous ceux qui sont Nan |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment