Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How do I deal with NaNs (not a number) in my data?

Data deal NaN
0
Posted

How do I deal with NaNs (not a number) in my data?

0

import numpy as N var1 = N.where(N.isnan(var[:]),var._FillValue[0],var[:]) • I’m trying to set the _FillValue attribute for my data, but getting an error message. If you are trying to set a _FillValue attribute for your data, and getting the error message: ncendef: ncid 65536: NetCDF: Not a valid data type or _FillValue type mismatch then this means you are using a value that is of the wrong type for your data variable. NetCDF requires the _FillValue type to be the same type as the variable it is attached to (for good reason). Furthermore, PyNIO treats an assignment to a _FillValue just like any other attribute assignment, meaning that it does not try to convert the type it is handed. If your data variable is a “float” in NetCDF, you must assign the _FillValue as a “numpy.float32”. If you assign it with the literal value “-999”, it will become an integer, which will not work. Unfortunately, even if you use the value “-999.0”, it will not work, because the default float type in Python (

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123