I have a
".txt"
file which has JSON data in it. I want to read this file in python and convert it into a dataframe.
The Data in this text file looks like this:
{
"_id" : "116b244599862fd2200",
"met_id" : [
612019,
621295,
725,
622169,
640014,
250,
350,
640015,
613689,
650423
],
"id" : "104",
"name" : "Energy",
"label" : "Peer Group",
"display_type" : "Risky Peer Group",
"processed_time" : ISODate("2019-04-18T11:17:05Z")
}
I tried reading it using the
pd.read_json
function but it always shows me an error. I am quite new to JSON, how can I use this Text file and load it in Python?