I have a JSON file in following format
{
"_id": {
"$oid": "5458c00ceb23024b941be4bb"
},
"gpstime": 0.046575,
"gpslat": 12.94492917,
"readingtime": {
"$date": "2014-11-04T17:28:10.000+0000"
},
"gpslong": 77.56115458,
"deviceid": "11119828",
"time": "Tue Nov 4 12:01:16 2014",
"location": [
12.94492917,
77.56115458
]
}
I used the following code to parse it but it is till missing out on date
import json
import csv
import pandas as pa
with open('readings.json', 'rb') as f:
data = f.readlines()
data = map(lambda x: x.rstrip(), data)
data_json_str = "[" + ','.join(data) + "]"
data_df = pa.read_json(data_json_str)
I get readingtime column as follows
readingtime {u'$date': u'2014-11-04T17:27:50.000+0000'}
But is missing out on %date
in reading time how to fix this ?