pandas.errors.DataError#

exception pandas.errors.DataError[source]#

在对非数值数据执行操作时引发的异常。

例如,在非数值列上调用 ohlc 或在滚动窗口上调用函数。

另请参阅

Series.rolling

为 Series 对象提供滚动窗口计算。

DataFrame.rolling

为 DataFrame 对象提供滚动窗口计算。

示例

>>> ser = pd.Series(["a", "b", "c"])
>>> ser.rolling(2).sum()
Traceback (most recent call last):
DataError: No numeric types to aggregate