Question

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

  • 15 April 2024
  • 1 reply
  • 31 views

Badge +1

(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

 

 


1 reply

Badge +1

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

Reply