Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduction of RangeIndex #9977

Closed
wants to merge 7 commits into from
Closed

Introduction of RangeIndex #9977

wants to merge 7 commits into from

Commits on Apr 24, 2015

  1. Introduction of RangeIndex

    `RangeIndex(1, 10, 2)` is a memory saving alternative to
    `Index(np.arange(1, 10,2))`: c.f. #939.
    
    This re-implementation is compatible with the current `Index()` api and is a
    drop-in replacement for `Int64Index()`. It automatically converts to
    Int64Index() when required by operations.
    
    At present only for a minimum number of operations the type is
    conserved (e.g. slicing, inner-, left- and right-joins). Most other operations
    trigger creation of an equivalent Int64Index (or at least an equivalent numpy
    array) and fall back to its implementation.
    
    This PR also extends the functionality of the `Index()` constructor to allow
    creation of `RangeIndexes()` with
    ```
    Index(20)
    Index(2, 20)
    Index(0, 20, 2)
    ```
    in analogy to
    ```
    range(20)
    range(2, 20)
    range(0, 20, 2)
    ```
    ARF committed Apr 24, 2015
    Configuration menu
    Copy the full SHA
    991c684 View commit details
    Browse the repository at this point in the history
  2. restore Index() fastpath precedence

    ARF committed Apr 24, 2015
    Configuration menu
    Copy the full SHA
    872775d View commit details
    Browse the repository at this point in the history

Commits on Apr 27, 2015

  1. Various fixes suggested by @jreback and @shoyer

    Cache a private Int64Index object the first time it or its values are required.
    Restore Index(5) as error. Restore its test. Allow Index(0, 5) and Index(0, 5, 1).
    Make RangeIndex immutable. See start, stop, step properties.
    In test_constructor(): check class, attributes (possibly including dtype).
    In test_copy(): check that copy is not identical (but equal) to the existing.
    In test_duplicates(): Assert is_unique and has_duplicates return correct values.
    ARF committed Apr 27, 2015
    Configuration menu
    Copy the full SHA
    57e0865 View commit details
    Browse the repository at this point in the history

Commits on May 1, 2015

  1. fix slicing

    ARF committed May 1, 2015
    Configuration menu
    Copy the full SHA
    e8c31c5 View commit details
    Browse the repository at this point in the history
  2. Set RangeIndex as default index

    * enh: set RangeIndex as default index
    * fix: pandas.io.packers: encode() and decode() for RangeIndex
    * enh: array argument pass-through
    * fix: reindex
    * fix: use _default_index() in pandas.core.frame.extract_index()
    * fix: pandas.core.index.Index._is()
    * fix: add RangeIndex to ABCIndexClass
    * fix: use _default_index() in _get_names_from_index()
    * fix: pytables tests
    * fix: MultiIndex.get_level_values()
    * fix: RangeIndex._shallow_copy()
    * fix: null-size RangeIndex equals() comparison
    * enh: make RangeIndex.is_unique immutable
    ARF committed May 1, 2015
    Configuration menu
    Copy the full SHA
    ac18a31 View commit details
    Browse the repository at this point in the history

Commits on May 2, 2015

  1. fix view

    ARF committed May 2, 2015
    Configuration menu
    Copy the full SHA
    b4d1085 View commit details
    Browse the repository at this point in the history
  2. enh: various performance optimizations

     * optimize argsort()
     * optimize tolist()
     * comment clean-up
    ARF committed May 2, 2015
    Configuration menu
    Copy the full SHA
    c9ac12f View commit details
    Browse the repository at this point in the history