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
Copy file name to clipboardExpand all lines: doc/source/advanced.rst
+23-2
Original file line number
Diff line number
Diff line change
@@ -617,10 +617,20 @@ faster than fancy indexing.
617
617
timeit ser.ix[indexer]
618
618
timeit ser.take(indexer)
619
619
620
+
.. _indexing.index_types:
621
+
622
+
Index Types
623
+
-----------
624
+
625
+
We have discussed ``MultiIndex`` in the previous sections pretty extensively. ``DatetimeIndex`` and ``PeriodIndex``
626
+
are shown :ref:`here <timeseries.overview>`. ``TimedeltaIndex`` are :ref:`here <timedeltas.timedeltas>`.
627
+
628
+
In the following sub-sections we will highlite some other index types.
629
+
620
630
.. _indexing.categoricalindex:
621
631
622
632
CategoricalIndex
623
-
----------------
633
+
~~~~~~~~~~~~~~~~
624
634
625
635
.. versionadded:: 0.16.1
626
636
@@ -702,10 +712,21 @@ values NOT in the categories, similarly to how you can reindex ANY pandas index.
702
712
In [12]: pd.concat([df2, df3]
703
713
TypeError: categories must match existing categories when appending
704
714
715
+
.. _indexing.rangeindex:
716
+
717
+
Int64Index and RangeIndex
718
+
~~~~~~~~~~~~~~~~~~~~~~~~~
719
+
720
+
``Int64Index``is a fundamental basic index in*pandas*. This is an Immutable array implementing an ordered, sliceable set.
721
+
Prior to 0.18.0, the ``Int64Index`` would provide the default index forall``NDFrame`` objects.
722
+
723
+
``RangeIndex``is a sub-class of ``Int64Index`` added in version 0.18.0, now providing the default index forall``NDFrame`` objects.
724
+
``RangeIndex``is an optimized version of ``Int64Index`` that can represent a monotonic ordered set. These are analagous to python :ref:`range types <https://docs.python.org/3/library/stdtypes.html#typesseq-range>`.
Copy file name to clipboardExpand all lines: doc/source/whatsnew/v0.18.0.txt
+34
Original file line number
Diff line number
Diff line change
@@ -19,6 +19,7 @@ Highlights include:
19
19
20
20
- Window functions are now methods on ``.groupby`` like objects, see :ref:`here <whatsnew_0180.enhancements.moments>`.
21
21
- ``pd.test()`` top-level nose test runner is available (:issue:`4327`)
22
+
- Adding support for a ``RangeIndex`` as a specialized form of the ``Int64Index`` for memory savings, see :ref:`here <whatsnew_0180.enhancements.rangeindex>`.
22
23
23
24
Check the :ref:`API Changes <whatsnew_0180.api>` and :ref:`deprecations <whatsnew_0180.deprecations>` before updating.
24
25
@@ -102,6 +103,39 @@ And multiple aggregations
102
103
r.agg({'A' : ['mean','std'],
103
104
'B' : ['mean','std']})
104
105
106
+
.. _whatsnew_0180.enhancements.rangeindex:
107
+
108
+
Range Index
109
+
^^^^^^^^^^^
110
+
111
+
A ``RangeIndex`` has been added to the ``Int64Index`` sub-classes to support a memory saving alternative for common use cases. This has a similar implementation to the python ``range`` object (``xrange`` in python 2), in that it only stores the start, stop, and step values for the index. It will transparently interact with the user API, converting to ``Int64Index`` if needed.
112
+
113
+
This will now be the default constructed index for ``NDFrame`` objects, rather than previous an ``Int64Index``. (:issue:`939`)
0 commit comments