Pandas¶
Doc: https://pandas.pydata.org/docs/reference/index.html
Pandas: Panel data (Python data analysis)
While pandas adopts many coding idioms from NumPy, the biggestabout difference is that pandas is designed for working with tabular or heterogeneous data. NumPy, by contrast, is best suited for working with homogeneously typed numerical array data.
Pandas provides two types of classes for handling data:
Series: a one-dimensional labeled (indexed) array holding data of any type such as integers, strings, Python objects etc.
DataFrame: a two-dimensional data structure that holds data like a two-dimension array or a table with rows and columns. The DataFrame has both a row and column index; it can be thought of as a dictionary of Series all sharing the same index.
import pandas as pd
obj = pd.Series([4, 7, -5, 3])
obj
0 4 1 7 2 -5 3 3 dtype: int64
obj.array, obj.index
(<NumpyExtensionArray> [np.int64(4), np.int64(7), np.int64(-5), np.int64(3)] Length: 4, dtype: int64, RangeIndex(start=0, stop=4, step=1))