Coder Social home page Coder Social logo

Comments (5)

Aloqeely avatar Aloqeely commented on June 1, 2024

Thanks for your report! It will be hard to guess what is causing the error since that JSON file is not small.
Could you provide a simpler JSON file that reproduces the error and show why it is a valid JSON object to pass to pd.read_json?

from pandas.

kuhlaid avatar kuhlaid commented on June 1, 2024

This is a shorter version of the JSON than what I am trying to use. I'm not aware of any different versions or exceptions for JSON validation. I'm only using a validator such as https://jsonlint.com/.

from pandas.

Aloqeely avatar Aloqeely commented on June 1, 2024

Ah, I see.
Your file is in fact a valid JSON file, but I was talking about whether it is appropriate to pass it to a DataFrame.
Maybe you want to parse it to a dictionary instead? You can do that using the json module.

from pandas.

kuhlaid avatar kuhlaid commented on June 1, 2024

This is more of a documentation issue than anything or maybe changing the error text is more appropriate. Maybe saying All arrays must be of the same length. Check that your JSON is appropriately organized for conversion to a Dataframe. In other words, the documentation seems to suggest that the read_json function will process any JSON, which it is not meant to do.

from pandas.

kuhlaid avatar kuhlaid commented on June 1, 2024

Just consider changing the documentation to note the appropriate JSON organization for Dataframes since the organization of the JSON matters. :)

from pandas.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.