Last active
November 18, 2020 13:51
-
-
Save mesmacosta/f4814e34f60fb1fe3cb9a0acb0502f87 to your computer and use it in GitHub Desktop.
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 json | |
| with open('data.json', 'w') as outfile: | |
| json.dump(obj, outfile) |
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 json | |
| with open('metadata.json', 'w') as outfile: | |
| obj = json.dumps(metadata_dict, default=str) | |
| outfile.write(obj) |
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 json | |
| import pandas as pd | |
| def default(o): | |
| if isinstance(o, pd.Timestamp): | |
| return o.isoformat() | |
| with open('metadata.json', 'w') as outfile: | |
| obj = json.dumps(metadata_dict, default=default) | |
| outfile.write(obj) |
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
| scraped_dataframe.to_csv('dump.csv', sep=',', encoding='utf-8', index=False) |
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 json | |
| with open('databases.json', 'w') as outfile: | |
| json.dump(([database.dump() for database in databases]), outfile) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment