Reputation: 151
JSON File:-
{"customer_name":"james",
"customer_id":41
}
my Python code below gives the error message :-
" ValueError: If using all scalar values, you must pass an index "
Please let me know what is the issue in the below code.
import pandas
pandas.read_json("p1.json").to_excel("out-put.xlsx")
Upvotes: 2
Views: 139
Reputation: 537
You can try:
pandas.read_json("p1.json", typ = 'series')
It creates pd.Series
Upvotes: 2