0

I have a JSON file around 120Mb, I tried converting the JSON file to CSV by running a python script

code:

import pandas as pd
file_path =r'D:\filename.json'
read_file = pd.read_json (file_path)
export_file_path = r'D:\output.csv'
read_file.to_csv (export_file_path, index = None, header=True)

The JSON file looks like this

[{"dateTime": "2019-11-01 00:00:05", "value": {"bpm": 54, "confidence": 3}}, {"dateTime": "2019-11-01 00:00:10", "value": {"bpm": 52, "confidence": 3}}..........

The CSV File looks like this

enter image description here

How can I get only the bpm values and also I want to remove the confidence values

1 Answer 1

1

You need to first create a dataframe from the JSON file It will have three columns: dateTime, bpm and confidence then df = df.drop(columns=['confidence'])

Then use df.to_csv

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.