Numpy - Replace a number with NaN

后端 未结 1 1138
[愿得一人]
[愿得一人] 2020-11-29 08:55

I am looking to replace a number with NaN in numpy and am looking for a function like numpy.nan_to_num, except in reverse.

The number is likely to change as differen

相关标签:
1条回答
  • 2020-11-29 09:44
    A[A==NDV]=numpy.nan
    

    A==NDV will produce a boolean array that can be used as an index for A

    0 讨论(0)
提交回复
热议问题