Pandas is the primary Python library for data analysis. It provides two data structures: Series (1D labelled array) and DataFrame (2D labelled table), with powerful tools for loading, cleaning, transforming, and analysing data.
pip install pandas
import pandas as pd
import numpy as np
# Series
s = pd.Series([10, 20, 30], index=['a','b','c'])
# DataFrame
df = pd.DataFrame({
'name': ['Alice', 'Bob', 'Carol'],
'age': [28, 34, 25],
'score': [95.5, 87.0, 92.3]
})
print(df.shape) # (3, 3)
print(df.dtypes)