-
-
Notifications
You must be signed in to change notification settings - Fork 19.1k
Description
Feature Type
-
Adding new functionality to pandas
-
Changing existing functionality in pandas
-
Removing existing functionality in pandas
Problem Description
We'd love for Pandas to automatically detect what orient=
should be for read_json
if the orient was 'table' or 'split' and the argument wasn't supplied (seems unsupported as of 2.0.0).
Feature Description
For example, this would ideally not throw "ValueError: Mixing dicts with non-Series may lead to ambiguous ordering.", and instead work as if orient='table'
was supplied to read_json
:
import pandas as pd
df = pd.DataFrame({"A": [1, 2, 3],})
df.to_json('test.json', indent=1, orient= 'table')
read = pd.read_json('test.json')
print(read)
Alternative Solutions
I'm sorry but I'm not much of a programmer and wouldn't know where to begin designing a solution. Some except block that try
s on the ValueError?
Additional Context
This isn't a huge problem but it recently caused several beginners many headaches and would be a subtle improvement to Pandas overall. If this is an easy fix then great, otherwise sorry for the dumb suggestion!