Python Forum

Full Version: Read json array data by pandas
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
we have an existing script to read json file from S3 and convert into parquet format, data receiving below format and we are able to read by below code,

json file content: [ {"Id":"123124","Account__c":"0ereeraw334U","Active__c":"true"} ]

existing code to convert into data frame: df = pd.read_json(obj['Body'],dtype='unicode',convert_dates=False)

But we are unable to read below json data in same way, getting incorrect data.

Json content: {"cust_land_detail":[ {"Id":"45634653","Account__c":"sersff23se","Active__c":"true"} ] }

NB: file has a root element, so unable to encode data.