You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When creating the union of an index with itself, the frequency may end up being reset. I would have expected the call to union in the following example to be invariant and return the original index:
In [56]: index = pd.bdate_range('20150101', periods=10)
In [57]: index.freq = None
In [58]: index
Out[58]:
<class 'pandas.tseries.index.DatetimeIndex'>
[2015-01-01, ..., 2015-01-14]
Length: 10, Freq: None, Timezone: None
In [59]: index.union(index)
Out[59]:
<class 'pandas.tseries.index.DatetimeIndex'>
[2015-01-01, ..., 2015-01-14]
Length: 10, Freq: B, Timezone: None
This then propagates through to e.g. combine_first, which is also not invariant. This might be desirable behavior in some cases but definitely surprising imo.
The text was updated successfully, but these errors were encountered:
When creating the union of an index with itself, the frequency may end up being reset. I would have expected the call to union in the following example to be invariant and return the original index:
This then propagates through to e.g.
combine_first
, which is also not invariant. This might be desirable behavior in some cases but definitely surprising imo.The text was updated successfully, but these errors were encountered: