【python程序】把小于10的数值都变成1
【python程序】把小于10的数值都变成1
import numpy as np
import xarray as xr
a = xr.DataArray(np.arange(25).reshape(5, 5))
a[np.where(a <= 10)] = 1
print(a)
【python程序】把小于10的数值都变成1
import numpy as np
import xarray as xr
a = xr.DataArray(np.arange(25).reshape(5, 5))
a[np.where(a <= 10)] = 1
print(a)