TB.M TB.M - 24 days ago 6
JSON Question

Exporting in JSON Format

I can export my data as CSV using:

df.reset_index().to_csv('MYDATASET.csv')


How can I export my result in JSON Array Format?

Answer

You can use orient='records'

print df.reset_index().to_json(orient='records')

Comments