Closed
Description
Here is the code:
import pandas as pd
df = pd.DataFrame([1, 2, 3], ['2016-01-01', '2017-01-01', '2018-01-01'], columns=['a'])
df.index = pd.to_datetime(df.index)
df.merge(df, on=['a', df.index.year])
This works in v0.19.0
, but in v0.22.0
fails with:
KeyError: "Int64Index([2016, 2017, 2018], dtype='int64') not in index"
In v0.19.0
, the merge produces a result (not sure if I agree with it though):
a key_1
0 1 2016
1 2 2017
2 3 2018