![]() This is what I have so far when I want to test it: Attempted Code import json, pandas I know it requires a for loop and if statement to specify the key names later on, but not sure the best way to implement it. The rest is useless information (such as statusCode) or it's duplicated under a different key name (such as profile and userInfo). In the example at the bottom, I only want everything under the following keys: created, emails, and identities. ![]() # Export to CSV in the same directory with the original file nameĮxport_csv = df.to_csv (file_path + r'.csv', sep=',', encoding='utf-8', index=None, header=True) # Enter the path to the JSON and the filename without appending '.json'ĭic = json.load(open(file_path + '.json', 'r', encoding='utf-8', errors='ignore'))ĭic_flattened = (flatten(d, '.') for d in dic) ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |