xarray发出未来警告

2024-04-25 17:55:03 发布

您现在位置:Python中文网/ 问答频道 /正文

刚刚升级到python3.8,我已将xarray更新到v.0.16,但现在我总是收到以下警告:

/usr/local/lib/python3.8/dist-packages/xarray/core/common.py:1123: FutureWarning: 'base' in .resample() and in Grouper() is deprecated.
The new arguments that you should use are 'offset' or 'origin'.

>>> df.resample(freq="3s", base=2)

becomes:

>>> df.resample(freq="3s", offset="2s")

  grouper = pd.Grouper(

我脚本中唯一使用的点。重采样是:

mydata = xr.open_dataset(ncfile).resample(time='3H').reduce(np.mean)

但我不知道如何改变它以避免警告


Tags: incore警告dfbaselibpackagesusr