Python Forum
Read json array data by pandas
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Read json array data by pandas
#1
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.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to compare two json and write to third json differences with pandas and numpy onenessboy 0 422 Jul-24-2020, 01:56 PM
Last Post: onenessboy
  Adding data in 3D array from 2D numpy array asmasattar 0 375 Jul-23-2020, 10:55 AM
Last Post: asmasattar
  pandas read_csv can't handle missing data mrdominikku 0 359 Jul-09-2020, 12:26 PM
Last Post: mrdominikku
  Pandas data frame creation from Kafka Topic vboppa 0 219 Jul-01-2020, 04:23 PM
Last Post: vboppa
  Generate Test data (.csv) using Pandas Ashley 5 489 Jun-15-2020, 02:51 PM
Last Post: jefsummers
  Can't read text file with pandas zinho 6 3,680 May-24-2020, 06:13 AM
Last Post: azajali43
  Creating look up table/matrix from 3d data array chai0404 3 503 Apr-09-2020, 04:53 AM
Last Post: buran
  add formatted column to pandas data frame alkaline3 0 358 Mar-22-2020, 06:44 PM
Last Post: alkaline3
  Transform Facebook Graph API insights JSON to pandas dataframe usman 0 529 Mar-03-2020, 05:14 AM
Last Post: usman
  Read file Into array with just $0d as Newline lastyle 5 750 Feb-03-2020, 11:58 PM
Last Post: lastyle

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020