3 MultiIndex / Advanced Indexing
This section covers indexing with a MultiIndex
and more advanced indexing features.
See the Indexing and Selecting Data for general indexing documentation.
Warning
Whether a copy or a reference is returned for a setting operation, may
depend on the context. This is sometimes called chained assignment
and
should be avoided. See Returning a View versus Copy
Warning
In 0.15.0 Index
has internally been refactored to no longer sub-class ndarray
but instead subclass PandasObject
, similarly to the rest of the pandas objects. This should be
a transparent change with only very limited API implications (See the Internal Refactoring)
See the cookbook for some advanced strategies
In [1]: import numpy as np
In [2]: import pandas as pd
In [3]: np.random.seed(123456)
In [4]: np.set_printoptions(precision=4, suppress=True)
In [5]: pd.options.display.max_rows=8