I am trying to construct a Json structure from the csv file. This below code gives me the error stating :- AttributeError: 'tuple' object has no attribute 'to_json' . I am new to python world and would like to ask for your help on this.
CSV Data Look like this:
I want output to be like below
[
{"Variable": "Latitude",
"Min": "78",
"Q1": "89"} ,
{"Variable": "Longitude",
"Min": "78",
"Q1": "89"},
{"Variable": "Zip",
"Min": "78",
"Q1": "89"}
]
import pandas
res_data = pd.read_csv("C\\Documents\\abc.csv", 'r')
abc=res_data.to_json(orient='records')
print(abc)

res_dfhere?