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
API: allow scalar setting/getting via float indexer on integer indexes
closes#12333
Author: Jeff Reback <[email protected]>
Closes#12370 from jreback/float and squashes the following commits:
3a148a7 [Jeff Reback] API: allow scalar setting/getting via float indexer on integer indexes
Copy file name to clipboardExpand all lines: doc/source/advanced.rst
+7-4
Original file line number
Diff line number
Diff line change
@@ -717,6 +717,10 @@ values NOT in the categories, similarly to how you can reindex ANY pandas index.
717
717
Int64Index and RangeIndex
718
718
~~~~~~~~~~~~~~~~~~~~~~~~~
719
719
720
+
.. warning::
721
+
722
+
Indexing on an integer-based Index with floats has been clarified in0.18.0, for a summary of the changes, see :ref:`here <whatsnew_0180.float_indexers>`.
723
+
720
724
``Int64Index``is a fundamental basic index in*pandas*. This is an Immutable array implementing an ordered, sliceable set.
721
725
Prior to 0.18.0, the ``Int64Index`` would provide the default index forall``NDFrame`` objects.
722
726
@@ -736,7 +740,6 @@ Float64Index
736
740
operations by about 30xand boolean indexing operations on the
737
741
``Float64Index`` itself are about 2xas fast.
738
742
739
-
740
743
.. versionadded:: 0.13.0
741
744
742
745
By default a ``Float64Index`` will be automatically created when passing floating, or mixed-integer-floating values in index creation.
@@ -797,12 +800,12 @@ In non-float indexes, slicing using floats will raise a ``TypeError``
797
800
798
801
.. warning::
799
802
800
-
Using a scalar float indexer has been removed in0.18.0, so the following will raise a ``TypeError``
803
+
Using a scalar float indexer for``.iloc``has been removed in0.18.0, so the following will raise a ``TypeError``
801
804
802
805
.. code-block:: python
803
806
804
-
In [3]: pd.Series(range(5))[3.0]
805
-
TypeError: cannot do label indexing on <class'pandas.indexes.range.RangeIndex'>with these indexers [3.0] of <type'float'>
807
+
In [3]: pd.Series(range(5)).iloc[3.0]
808
+
TypeError: cannot do positional indexing on <class'pandas.indexes.range.RangeIndex'>with these indexers [3.0] of <type'float'>
806
809
807
810
Further the treatment of ``.ix``with a float indexer on a non-float index, will be label based, and thus coerce the index.
Copy file name to clipboardExpand all lines: doc/source/indexing.rst
+4
Original file line number
Diff line number
Diff line change
@@ -53,6 +53,10 @@ advanced indexing.
53
53
but instead subclass ``PandasObject``, similarly to the rest of the pandas objects. This should be
54
54
a transparent change with only very limited API implications (See the :ref:`Internal Refactoring <whatsnew_0150.refactoring>`)
55
55
56
+
.. warning::
57
+
58
+
Indexing on an integer-based Index with floats has been clarified in 0.18.0, for a summary of the changes, see :ref:`here <whatsnew_0180.float_indexers>`.
59
+
56
60
See the :ref:`MultiIndex / Advanced Indexing <advanced>` for ``MultiIndex`` and more advanced indexing documentation.
57
61
58
62
See the :ref:`cookbook<cookbook.selection>` for some advanced strategies
0 commit comments