Last active
February 18, 2018 18:46
-
-
Save gitdagray/77fd5b8f801c4feb0aaedd08d7751c79 to your computer and use it in GitHub Desktop.
Converting pandas dataframes to JSON
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
#loop has completed | |
#end the Selenium browser session | |
driver.quit() | |
#combine all pandas dataframes in the list into one big dataframe | |
result = pd.concat([pd.DataFrame(datalist[i]) for i in range(len(datalist))],ignore_index=True) | |
#convert the pandas dataframe to JSON | |
json_records = result.to_json(orient='records') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment