'pandas'没有属性'tslib'


df['tick'] = np.where(df.Length < .05, df.index, pd.tslib.NaT)

AttributeError: module 'pandas'没有属性'tslib'当我运行这个命令时,它显示没有找到pandas tslib,我该如何解决它

你只能使用pd.NaT:

df['tick'] = np.where(df.Length < .05, df.index, pd.NaT)

在这个GitHub线程中提到:

FutureWarning: pandas.tslib is deprecated and will be removed in a future version.

所以它现在被移除并且无法访问。

最新更新