<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Xarray library core functions now failing in Pro 3.2 in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/xarray-library-core-functions-now-failing-in-pro-3/m-p/1347041#M74965</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;I have a netcdf file with x, y and time dims (see attached). I put it through the following code in a Pro notebook:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;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()&lt;/LI-CODE&gt;&lt;P&gt;The resample function results in a type error:&amp;nbsp;__init__() got an unexpected keyword argument 'base'. Looking on the net indicates this could be due to an incompatibility between Xarray and python versions.&lt;/P&gt;&lt;P&gt;The interpolate_na fucntion returns an attribute error:&amp;nbsp;'DatetimeIndex' object has no attribute 'is_monotonic'. I have tried on several netcdfs with multiple dates and same issue.&lt;/P&gt;&lt;P&gt;All data tested worked a week ago in Pro 3.1 (and earlier), so something has happened with Pro 3.2.&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;Any advice or knowledge on this would be appreciated.&lt;/P&gt;&lt;P&gt;Lewis&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 08 Nov 2023 08:10:13 GMT</pubDate>
    <dc:creator>LewisTrotter</dc:creator>
    <dc:date>2023-11-08T08:10:13Z</dc:date>
    <item>
      <title>Xarray library core functions now failing in Pro 3.2</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/xarray-library-core-functions-now-failing-in-pro-3/m-p/1347041#M74965</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;I have a netcdf file with x, y and time dims (see attached). I put it through the following code in a Pro notebook:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;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()&lt;/LI-CODE&gt;&lt;P&gt;The resample function results in a type error:&amp;nbsp;__init__() got an unexpected keyword argument 'base'. Looking on the net indicates this could be due to an incompatibility between Xarray and python versions.&lt;/P&gt;&lt;P&gt;The interpolate_na fucntion returns an attribute error:&amp;nbsp;'DatetimeIndex' object has no attribute 'is_monotonic'. I have tried on several netcdfs with multiple dates and same issue.&lt;/P&gt;&lt;P&gt;All data tested worked a week ago in Pro 3.1 (and earlier), so something has happened with Pro 3.2.&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;Any advice or knowledge on this would be appreciated.&lt;/P&gt;&lt;P&gt;Lewis&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Nov 2023 08:10:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/xarray-library-core-functions-now-failing-in-pro-3/m-p/1347041#M74965</guid>
      <dc:creator>LewisTrotter</dc:creator>
      <dc:date>2023-11-08T08:10:13Z</dc:date>
    </item>
    <item>
      <title>Re: Xarray library core functions now failing in Pro 3.2</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/xarray-library-core-functions-now-failing-in-pro-3/m-p/1347042#M74966</link>
      <description>&lt;P&gt;Further information: this appears to be an issue with pandas/xarray&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/pydata/xarray/issues/8282" target="_blank"&gt;https://github.com/pydata/xarray/issues/8282&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Nov 2023 08:25:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/xarray-library-core-functions-now-failing-in-pro-3/m-p/1347042#M74966</guid>
      <dc:creator>LewisTrotter</dc:creator>
      <dc:date>2023-11-08T08:25:31Z</dc:date>
    </item>
    <item>
      <title>Re: Xarray library core functions now failing in Pro 3.2</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/xarray-library-core-functions-now-failing-in-pro-3/m-p/1347223#M74977</link>
      <description>&lt;P&gt;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:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Create a clone of arcgispro-py3, this can be done through pro's Package Manager UI in the settings, or through the Python Command Prompt.&amp;nbsp;&lt;UL&gt;&lt;LI&gt;If using the Python Command Prompt use this syntax:&lt;/LI&gt;&lt;LI&gt;&lt;PRE&gt;conda create --clone arcgispro-py3 -n clone-name --pinned&lt;/PRE&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;Launch the Python Command Prompt (if its not already open)&lt;/LI&gt;&lt;LI&gt;Switch to your clone with `proswap clone-name`&lt;UL&gt;&lt;LI&gt;This will make your clone the default environment when you launch Pro&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;Finally update xarray with:&lt;UL&gt;&lt;LI&gt;&lt;PRE&gt;conda install xarray --no-deps -y&lt;/PRE&gt;&lt;/LI&gt;&lt;LI&gt;This will only update xarray to the latest 2023.6.0 version&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;Using this environment your above code should work now&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;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).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Nov 2023 16:02:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/xarray-library-core-functions-now-failing-in-pro-3/m-p/1347223#M74977</guid>
      <dc:creator>BrianClee</dc:creator>
      <dc:date>2023-11-08T16:02:03Z</dc:date>
    </item>
  </channel>
</rss>

