A DataFrame is a 2D table with rows & columns — like Excel or SQL table.
Each column is a Series → same power + table structure.
import pandas as pd
data = {
"name": ["Alice", "Bob", "Charlie"],
"age": [25, 30, 35],
"city": ["NY", "LA", "SF"]
}
df = pd.DataFrame(data)
print(df)
Rows indexed 0,1,2; columns: name, age, city.
df["age"] or df.agedf.loc[1] (label) or df.iloc[1] (position)df.loc[1, "city"] or df.at[1, "city"]df["country"] = "USA"df.drop("country", axis=1)axis=0 = rows, axis=1 = columns.