nodata_value for zonal_stats doesn't appear to work
See original GitHub issueDescribe the bug
Running zonal_stats and passing in the argument nodata_values = -99999
results in a
ValueError: All arrays must be of the same length
stack trace with method and line number
zonal.py line 519
zonal.py 335
python3.7/site-packages/pandas/core/frame.py 614
python3.7/site-packages/pandas/core/internals/construction.py 465
When i run zonal_stats without the nodata_values
argument it runs fine and computes
nodata_values = -99999
or nodata_values = -99999.0
Expected behavior Would expect the method zonal_stats to return statistics computed ignoring pixels with nodata_values
Screenshots Unable to provide screenshots, running this in a classified environment
Desktop (please complete the following information): Running this in Databricks 7.3LTS with Python 3.7.5, xarray-spatial 0.3.0
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top GitHub Comments
Good point, I don’t think there were any positive values in the array with 99999 so maybe that’s why the case worked. I haven’t had a chance to swap out for Nan but I will test both cases when I’m back from the holidays.
On Thu, Dec 16, 2021, 09:24 thuydotm @.***> wrote:
Fixed in https://github.com/makepath/xarray-spatial/pull/581