I have nd-array with 7 dimensions. I want to change in each band the 0 value into None value (nan).
I have tried to this it like this:
band[band == 0] = "nan"
but then I got the error message:
ValueError: invalid literal for int() with base 10: 'nan'
I have tried to change the nan to None and also np.nan but for the none I have got following error:
TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'
and for np.nan:
ValueError: cannot convert float NaN to integer
The array values type is numpy.int64 .
My endgoal here is to be able to change the 0 values into nan values for the array.