Overview of [] (getitem) API · Issue #9595 · pandas-dev/pandas (original) (raw)

some examples (on Series only) in #12890

I started making an overview of the indexing semantics with http://nbviewer.ipython.org/gist/jorisvandenbossche/7889b389a21b41bc1063 (only for series/frame, not for panel)

Conclusion: it is mess :-)


Summary for slicing

So, you can say that the behaviour is equivalent to .ix, except that the behaviour for integer labels is different for integer indexers (swapped). (For .ix, when having an integer axis, it is always label based and no fallback to integer location based).

Summary for single label

Summary for indexing with list of labels

This mainly follows ix, apart from points 2 and 3

Summary for boolean indexing

Summary for DataFrames

This is as documented (only the boolean case is not explicitely documented I think).

For the rest (on the choses axis), it follows the same semantics as [] on a series, but:


Questions are here: