I don't know why the original content of id_1 & id_2 changes when I print it.
I have a json file named test_data.json
{
"objects":{
"value":{
"1298543947669573634":{
"timestamp":"Wed Aug 26 08:52:57 +0000 2020",
"id_1":"1298543947669573634",
"id_2":"1298519559306190850"
}
}
}
}
Output
python test_data.py
id_1 id_2 timestamp
0 1298543947669573632 1298519559306190848 2020-08-26 08:52:57+00:00
My code named test_data.py is
import pandas as pd
import json
file = "test_data.json"
with open (file, "r") as f:
all_data = json.loads(f.read())
data = pd.read_json(json.dumps(all_data['objects']['value']), orient='index')
data = data.reset_index(drop=True)
print(data.head())
How can I fix this, so the numeric values are interpreted correctly?