Solved

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

  • 15 April 2024
  • 2 replies
  • 56 views

Badge +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

 

 

icon

Best answer by Dilini Fernando 31 May 2024, 13:49

View original

2 replies

Badge +4

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

Userlevel 4
Badge +2

This has been addressed here

 

Reply