{"action":"created","issue":{"url":"https://api.github.com/repos/pydata/pandas/issues/11892","labels_url":"https://api.github.com/repos/pydata/pandas/issues/11892/labels{/name}","comments_url":"https://api.github.com/repos/pydata/pandas/issues/11892/comments","events_url":"https://api.github.com/repos/pydata/pandas/issues/11892/events","html_url":"https://github.com/pydata/pandas/pull/11892","id":123729850,"number":11892,"title":"ENH: RangeIndex redux","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},"labels":[{"url":"https://api.github.com/repos/pydata/pandas/labels/Enhancement","name":"Enhancement","color":"4E9A06"},{"url":"https://api.github.com/repos/pydata/pandas/labels/Indexing","name":"Indexing","color":"0b02e1"},{"url":"https://api.github.com/repos/pydata/pandas/labels/Performance","name":"Performance","color":"a10c02"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/pydata/pandas/milestones/36","html_url":"https://github.com/pydata/pandas/milestones/0.18.0","labels_url":"https://api.github.com/repos/pydata/pandas/milestones/36/labels","id":1214851,"number":36,"title":"0.18.0","description":"","creator":{"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},"open_issues":67,"closed_issues":142,"state":"open","created_at":"2015-07-19T20:18:45Z","updated_at":"2016-01-08T18:20:15Z","due_on":"2016-01-31T05:00:00Z","closed_at":null},"comments":21,"created_at":"2015-12-23T22:10:54Z","updated_at":"2016-01-08T19:36:22Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/pydata/pandas/pulls/11892","html_url":"https://github.com/pydata/pandas/pull/11892","diff_url":"https://github.com/pydata/pandas/pull/11892.diff","patch_url":"https://github.com/pydata/pandas/pull/11892.patch"},"body":"closes #939 \r\nreplaces #9977 \r\n\r\nToDo:\r\n- [x] test for packers.py\r\n- [x] more code review\r\n\r\nMuch commentary on the original issue #9977 \r\n\r\nbut in essence ``RangeIndex`` is a complete replacement for ``Int64Index``, which all indexing semantics and interop. This is now the default indexer upon construction. It should be completely transparent to the end user.\r\n\r\nIt provides a constant memory footprint for any size of index. Their is a tiny penalty for < about 10 elements (which is actually trivial to fix, e.g. we could simply instantiate an ``Int64Index`` for these cases). But I think it is more natural to *always* get a ``RangeIndex``.\r\n\r\nOne other change here is to ``assert_index_equal`` the ``exact`` kw now takes ``equiv`` as the default (in addition to a boolean) to allow for exact comparisions except for ``Int64Index``/``RangeIndex`` are considered equivalent (as are string/unicode as inferred types, this was pre-existing).\r\n\r\n```\r\nIn [1]: s = Series(range(5))\r\n\r\nIn [2]: s.index\r\nOut[2]: RangeIndex(start=0, stop=5, step=1)\r\n\r\nIn [3]: s.nbytes\r\nOut[3]: 40\r\n\r\nIn [4]: s.index.nbytes\r\nOut[4]: 72\r\n\r\nIn [5]: s.index.astype(int).nbytes\r\nOut[5]: 40\r\n\r\nIn [6]: s = Series(range(100))\r\n\r\nIn [7]: s.index.astype(int).nbytes\r\nOut[7]: 800\r\n\r\nIn [8]: s.index.nbytes\r\nOut[8]: 72\r\n```"},"comment":{"url":"https://api.github.com/repos/pydata/pandas/issues/comments/170101764","html_url":"https://github.com/pydata/pandas/pull/11892#issuecomment-170101764","issue_url":"https://api.github.com/repos/pydata/pandas/issues/11892","id":170101764,"user":{"login":"jorisvandenbossche","id":1020496,"avatar_url":"https://avatars.githubusercontent.com/u/1020496?v=3","gravatar_id":"","url":"https://api.github.com/users/jorisvandenbossche","html_url":"https://github.com/jorisvandenbossche","followers_url":"https://api.github.com/users/jorisvandenbossche/followers","following_url":"https://api.github.com/users/jorisvandenbossche/following{/other_user}","gists_url":"https://api.github.com/users/jorisvandenbossche/gists{/gist_id}","starred_url":"https://api.github.com/users/jorisvandenbossche/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jorisvandenbossche/subscriptions","organizations_url":"https://api.github.com/users/jorisvandenbossche/orgs","repos_url":"https://api.github.com/users/jorisvandenbossche/repos","events_url":"https://api.github.com/users/jorisvandenbossche/events{/privacy}","received_events_url":"https://api.github.com/users/jorisvandenbossche/received_events","type":"User","site_admin":false},"created_at":"2016-01-08T19:36:22Z","updated_at":"2016-01-08T19:36:22Z","body":"A little bit usage feedback:\r\n\r\n- I find it a bit strange that list and array are handled differently:\r\n\r\n  ```\r\nIn [17]: pd.RangeIndex([1,2,3])\r\nTypeError: RangeIndex(...) must be called with integers, [1, 2, 3] was passed fo\r\nr start\r\n\r\nIn [18]: pd.RangeIndex(np.array([1,2,3]))\r\nOut[18]: Int64Index([1, 2, 3], dtype='int64')\r\n  ```\r\n\r\nThis touches the point of @shoyer I think (the last part of the constructor code he mentioned) \r\n@jreback What is the reason that `Index, np.ndarray, ABCSeries` are passed through to the main constructor? \r\nAn example that not all other index objects are that flexible:\r\n\r\n```\r\nIn [58]: pd.Float64Index(np.array(['a', 'b']))\r\nTypeError: String dtype not supported, you may need to explicitly cast to a numeric type\r\n\r\nIn [59]: pd.RangeIndex(np.array(['a', 'b']))\r\nOut[59]: Index([u'a', u'b'], dtype='object')\r\n```\r\n"}}