
Step2: Now if I try to convert the JSON again to CSV, it's not getting converted in the same format as earlier: df = pd.read_csv('C://Users//DAMALI//Desktop/test.csv')ĭf.to_json('C://Users//DAMALI//Desktop/test1. Step 1: Converted JSON to CSV using pandas: df = pd.read_json('C://Users//DAMALI//Desktop/test.json')ĭf.to_csv('C://Users//DAMALI//Desktop/test.csv') Now when I am again converting the CSV into JSON using pandas< the data is not getting displayed in the correct format. I created a CSV file by reading a JSON using pandas for reference. The following example reads in the countries.csv. I am a tester and want to send some events to Event Hub for that I want to maintain a CSV file and update my records/data using the CSV file. The pandas.tojson() method converts a DataFrame object to a JSON string.

I want to convert a CSV to a JSON format using pandas.
