alteryx / alteryx/featuretools

RollingMean: index values must not have NaT

未關閉
#2,768 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
bug
主要語言
Python
星號
7.7k
分支
915
PR 合併指標
30 天內沒有已合併 PR

描述

[RollingMean: index values must not have NaT]

#### Code Sample, a copy-pastable example to reproduce your bug.

```python
def rolling_mean(datetime, numeric):
x = pd.Series(numeric.values, index=datetime.values)
return apply_rolling_agg_to_series(
x,
np.mean,
self.window_length,
self.gap,
self.min_periods,
)

======datetime======
0 2023-06-18
1 2023-06-18
2 2023-06-18
3 2023-06-18
4 NaT --> the value [2023-06-19] was set to NaT when the rolling date is 2023-06-18
...
77246 NaT
77247 NaT
77248 NaT
77249 NaT
77250 NaT
Name: wh_item_day_train.day_dt, Length: 77251, dtype: datetime64[ns]
```

#### Output of ``featuretools.show_info()``

Image

File "..\lib\site-packages\featuretools\computational_backends\feature_set_calculator.py", line 511, in _calculate_transform_features
values = feature_func(*column_data)
File "..\lib\site-packages\featuretools\primitives\standard\transform\time_series\rolling_mean.py", line 97, in rolling_mean
return apply_rolling_agg_to_series(
File "..\lib\site-packages\featuretools\primitives\standard\transform\time_series\utils.py", line 224, in apply_rolling_agg_to_series
rolled_series = roll_series_with_gap(series, window_length, gap, min_periods)
File "..\lib\site-packages\featuretools\primitives\standard\transform\time_series\utils.py", line 58, in roll_series_with_gap
return series.rolling(functional_window_length, min_periods)

ValueError: index values must not have NaT

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。