= Python Pandas Types = The '''types''' defined by the `pandas` module. <> ---- == DataFrame == For details on `pandas.core.frame.DataFrame`, see [[Python/Pandas/DataFrame|here]]. ---- == Index == The `pandas.core.indexes.base.Index` type is returned by the `columns` attribute on other data types, such as '''`DataFrame`'''. ---- == RangeIndex == The `pandas.core.indexes.range.RangeIndex` type is returned by the `index` attribute on other data types, such as '''`Series`'''. ---- == Series == For details on `pandas.core.series.Series`, see [[Python/Pandas/Series|here]]. ---- == _ILocIndexer == `pandas.core.indexing._iLocIndexer` is an accessor object returned by the `iloc` method. Even if there is a set index for the original object, this always looks up sequential integer indices. {{{ s.iloc[0] # first value by integer index s.iloc[-1] # last value s.iloc[:5] # slice of first 5 values s.iloc[:] # slice of all values s.iloc[[0, -1]] # first and last value }}} If there is more than one selected value, a new instance of the original data type is returned. If there is only one selected value, the underlying stored type is returned. {{{ s = pd.Series(["foo", "bar", "baz"]) type(s.iloc[:]) # pandas.core.series.Series type(s.iloc[0]) # str }}} Indexing can raise an [[Python/Builtins/Exceptions#IndexError|IndexError]]. Note that this is ''not'' a read-only view. {{{ s.iloc[0] = "Foo" s.iloc[[0, 1, 2]] = ["foo", "bar", "baz"] s.iloc[0:3] = ["foo", "bar", "baz"] }}} ---- == _LocIndexer == `pandas.core.indexing._LocIndexer` is an accessor object returned by the `loc` method. This works exactly like the '''`_iLocIndexer`''' except that it looks up the set index, rather than the underlying sequential integer index. ---- CategoryRicottone