Hello,
The recent Pro 3.2 update has broken some of the basic core features of the Xarray Python library which we rely on quite heavily and for years have had no issues with in Pro.
I have a netcdf file with x, y and time dims (see attached). I put it through the following code in a Pro notebook:
import xarray as xr
# load netcdf
ds = xr.open_dataset(r"C:\R2016-02-12.nc")
# this results in error now
ds.resample(time='1YS').mean()
# this results in error now
ds.interpolate_na('time').mean()
The resample function results in a type error: __init__() got an unexpected keyword argument 'base'. Looking on the net indicates this could be due to an incompatibility between Xarray and python versions.
The interpolate_na fucntion returns an attribute error: 'DatetimeIndex' object has no attribute 'is_monotonic'. I have tried on several netcdfs with multiple dates and same issue.
All data tested worked a week ago in Pro 3.1 (and earlier), so something has happened with Pro 3.2.
Normally I'd find a work around but because these functions are fundamental to the Xarray library (and to our plugins!) I have submitted here.
Any advice or knowledge on this would be appreciated.
Lewis
Solved! Go to Solution.
Hi Lewis thank you for this report, looks like our update to pandas 2 broke some xarray functionality. I was able to reproduce your error thanks to the data you supplied. I have a workaround that resolves the issue on my machine, could you try the following:
conda create --clone arcgispro-py3 -n clone-name --pinned
conda install xarray --no-deps -y
I'm working on getting this included in the 3.2.1 patch list to update arcgispro-py3's version of xarray but in the meantime the above workaround should help.
I have also attached my Python Command Prompt console log, this shows the commands I used to clone, swap to the clone, install xarray, and test the workflow (I also tested in the Pro app).
Further information: this appears to be an issue with pandas/xarray
https://github.com/pydata/xarray/issues/8282
Hi Lewis thank you for this report, looks like our update to pandas 2 broke some xarray functionality. I was able to reproduce your error thanks to the data you supplied. I have a workaround that resolves the issue on my machine, could you try the following:
conda create --clone arcgispro-py3 -n clone-name --pinned
conda install xarray --no-deps -y
I'm working on getting this included in the 3.2.1 patch list to update arcgispro-py3's version of xarray but in the meantime the above workaround should help.
I have also attached my Python Command Prompt console log, this shows the commands I used to clone, swap to the clone, install xarray, and test the workflow (I also tested in the Pro app).