Skip to content
Advertisement

ValueError: All arrays must be of the same length

can someone help with the error with converting a json file to a data frame pls

I’m trying to convert the JSON text file to a data frame but get the array same length error. I have tried double [[]] around the ‘data’ but still doesn’t work. The text file is at https://stackoverflowtez.filecloudonline.com/ui/core/index.html?mode=single&path=/SHARED/%212CkRNC5x55IO6kGJjEwTViZ4mGmwG/9aINFGD2QxaELHFL&shareto=#expl-tabl.

JavaScript

A portion of JSON pasted below, the whole output is in the convert.txt at the link

JavaScript

Thanks

Advertisement

Answer

The problem comes from the nested parts of your JSON file. You can use the json_normalize() function from Pandas to solve your issue :

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement