0

I have to analyse a .json file which looks like this:

{"columns":["id","timestamp","offset_freq","reprate_freq"],
"index":[0,1,2,3,4,5,6,7 ... 
"data":[[526144,1451900097533,20000000.495000001,250000093.9642499983],[...    }

it has over 600000 indexes so I dont want to show you the whole file.

I have found out that I can read the file simply by:

df = pd.read_json(file_name_or_Python_string, orient='split')

But what do I do now if I want to do some math on one of the columns? For example devide all the offset_freq by 2?

2 Answers 2

1

to divide 'offset_freq' by 2:

df['offset_freq']/2

I suggest you read 10 minutes to pandas for a quick pandas primer

http://pandas.pydata.org/pandas-docs/stable/10min.html

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

Comments

0

You'll want to parse the json and save into python data structures or objects for easy manipulation. How exactly you want to implement that depends on your needs and preferences.

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.