I have data in Pandas dataframe and I am able to write the dataframe data into JSON file by calling:
df.to_json('filepath', orient='records')
This writes data into json file as an array of JSON objects.
[{"col 1":"a","col 2":"b"},{"col 1":"c","col 2":"d"}]
I want data in the json file to be as below i.e. just comma seperated JSON objects without array
{"col 1":"a","col 2":"b"},{"col 1":"c","col 2":"d"}
Would appreciate any help. I am new to python and not able to find the way. Thank you.