Removing nan data variable values #9654
-
ProblemI'm trying to perform a Fourier transform of some gridded data in a dataset. However, I keep getting an error because there are some values of the data variable which are nan. Is there a way in which I can remove all datapoints in a grid which are attributed to a nan data variable? Meta Data of ArrayDimensions: northing: 58, easting: 71 Attempts to ResolveI have tried the method of doing I've also tried to use the Libraries and VersionsI'm using The Concluding wordsI feel this may not be possible to resolve, since it's a regular grid (meaning coordinates can't simply be removed) but I'd like to ask anyway in case I can. Looking forward to any responses. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I believe I've determined that, since I was using an However, when I converted it to an |
Beta Was this translation helpful? Give feedback.
I believe I've determined that, since I was using an
xarray.Dataset
, when it was being read bynumpy
in a test I was running (np.isnan(grid_to_array).any()
) it wasn't being read correctly, giving an error that there arenan
values because of the data type.However, when I converted it to an
xarray.DataArray
this problem was fixed, providingFalse
to the test.