Skip to main content
Solved

ValueError: Out of range float values are not JSON compliant.

  • April 15, 2024
  • 2 replies
  • 268 views

Forum|alt.badge.img+4

(Please forgive the erroneous posting of this under Academy Discussions)

Doing the ‘hands-on’ for Data Engineer Basics - “Learn to Use the Cognite Python SDK “ Course."

I have done the following:

  1. Make a dataframe from reading from a csv file:

    One of the columns in the csv file is ‘region’. The 5 different values in the region column are 

    When the above code is run, the  following appears on the screen:

    Q1. Does this mean pandas has interpreted the region “None” as “nan”?

If so that would explain why the following code throws “ValueError: Out of range float values are not JSON compliant. Make sure your data does not contain NaN(s) or +/- Inf!” 

 

I would value your guidance as I have not worked with pandas() much at all.

Thank you,

Doug

 

 

Best answer by Dilini Fernando

This has been addressed here

 

View original
Did this topic help you find an answer to your question?

2 replies

Forum|alt.badge.img+4
  • Author
  • Seasoned
  • 9 replies
  • April 15, 2024

OK, I replaced “None” with “Antarctica” in the ‘region’ column of the csv file.

Then, 

 

This does not help. The same error results.

 

Thanks.

Doug


Dilini Fernando
Seasoned Practitioner
Forum|alt.badge.img+2
  • Seasoned Practitioner
  • 671 replies
  • Answer
  • May 31, 2024

Reply


Cookie Policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie Settings