kaggle-web-traffic icon indicating copy to clipboard operation
kaggle-web-traffic copied to clipboard

Did someone make an error when running lag_indexes method in make_features file

Open timtian12 opened this issue 3 years ago • 3 comments

KeyError: "Passing list-likes to .loc or [] with any missing labels is no longer supported. The following labels were missing: DatetimeIndex(['2015-04-01', '2015-04-02', '2015-04-03', '2015-04-04',\n '2015-04-05',\n ...\n '2015-06-26', '2015-06-27', '2015-06-28', '2015-06-29',\n '2015-06-30'],\n dtype='datetime64[ns]', length=92, freq=None). See https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#deprecate-loc-reindex-listlike"

timtian12 avatar Mar 12 '21 10:03 timtian12

把.loc[]改成reindex()

1980695671 avatar Apr 02 '21 03:04 1980695671

把.loc[]改成reindex()

别乱回答

Tovi-A avatar May 16 '21 10:05 Tovi-A

Done, works just iloc[dates] to reindex(dates)

EnriqueGautoSand avatar Mar 14 '23 21:03 EnriqueGautoSand