I have a data frame I'm attempting to export to a json file. Currently my fame looks something like this
PRICE FRUIT COLOR
1 Apple Red
2 Orange Orange
When I use the following JSON call:
df.to_json(orient='records',lines=True)
I return
{'Price':1,'Fruit':Apple,'Color':Red}
{'Price':2,'Fruit':Orange,'Color':Orange}
when I want
[{'Price':1,'Fruit':Apple,'Color':Red}
{'Price':2,'Fruit':Orange,'Color':Orange}]
So that the JSON file doesn't read each item as the end of file.