{"action":"created","issue":{"url":"https://api.github.com/repos/pydata/pandas/issues/11086","labels_url":"https://api.github.com/repos/pydata/pandas/issues/11086/labels{/name}","comments_url":"https://api.github.com/repos/pydata/pandas/issues/11086/comments","events_url":"https://api.github.com/repos/pydata/pandas/issues/11086/events","html_url":"https://github.com/pydata/pandas/issues/11086","id":106209958,"number":11086,"title":"Union of index with itself not invariant, sets frequency attribute","user":{"login":"compandu","id":12200702,"avatar_url":"https://avatars.githubusercontent.com/u/12200702?v=3","gravatar_id":"","url":"https://api.github.com/users/compandu","html_url":"https://github.com/compandu","followers_url":"https://api.github.com/users/compandu/followers","following_url":"https://api.github.com/users/compandu/following{/other_user}","gists_url":"https://api.github.com/users/compandu/gists{/gist_id}","starred_url":"https://api.github.com/users/compandu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/compandu/subscriptions","organizations_url":"https://api.github.com/users/compandu/orgs","repos_url":"https://api.github.com/users/compandu/repos","events_url":"https://api.github.com/users/compandu/events{/privacy}","received_events_url":"https://api.github.com/users/compandu/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-09-13T10:52:27Z","updated_at":"2015-09-13T15:07:52Z","closed_at":null,"body":"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:\r\n```\r\nIn [56]: index = pd.bdate_range('20150101', periods=10)\r\nIn [57]: index.freq = None\r\nIn [58]: index\r\nOut[58]:\r\n<class 'pandas.tseries.index.DatetimeIndex'>\r\n[2015-01-01, ..., 2015-01-14]\r\nLength: 10, Freq: None, Timezone: None\r\n\r\nIn [59]: index.union(index)\r\nOut[59]:\r\n<class 'pandas.tseries.index.DatetimeIndex'>\r\n[2015-01-01, ..., 2015-01-14]\r\nLength: 10, Freq: B, Timezone: None\r\n```\r\nThis 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."},"comment":{"url":"https://api.github.com/repos/pydata/pandas/issues/comments/139885466","html_url":"https://github.com/pydata/pandas/issues/11086#issuecomment-139885466","issue_url":"https://api.github.com/repos/pydata/pandas/issues/11086","id":139885466,"user":{"login":"jreback","id":953992,"avatar_url":"https://avatars.githubusercontent.com/u/953992?v=3","gravatar_id":"","url":"https://api.github.com/users/jreback","html_url":"https://github.com/jreback","followers_url":"https://api.github.com/users/jreback/followers","following_url":"https://api.github.com/users/jreback/following{/other_user}","gists_url":"https://api.github.com/users/jreback/gists{/gist_id}","starred_url":"https://api.github.com/users/jreback/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jreback/subscriptions","organizations_url":"https://api.github.com/users/jreback/orgs","repos_url":"https://api.github.com/users/jreback/repos","events_url":"https://api.github.com/users/jreback/events{/privacy}","received_events_url":"https://api.github.com/users/jreback/received_events","type":"User","site_admin":false},"created_at":"2015-09-13T15:07:52Z","updated_at":"2015-09-13T15:07:52Z","body":"so the case is an index that has ``idx.freq is None`` with another will NOT take the fast path, but then both compare equal. ok so far.\r\n\r\nThen an infererence happens [here](https://github.com/pydata/pandas/blob/master/pandas/tseries/index.py#L899)\r\n\r\nI suppose if both have incoming ``freq is None`` then don't need to infer.\r\n\r\nNot sure what this would break though.\r\n\r\nwant to do a PR and see?"}}