A DataFrame is a 2D labeled data structure. Create from dicts, lists, or CSV files. Access columns with df["col"] or df.col.
import pandas as pd
data = {"name": ["Alice", "Bob"], "age": [30, 25]}
df = pd.DataFrame(data)
print(df)
print(df["name"])Create a DataFrame with columns "product" and "price" containing: Apple/1.5, Banana/0.5, Cherry/3.0. Print the DataFrame.
Loading Python runtime (Pyodide)...
Given a DataFrame with products and prices, print only products with price > 1.0.
Loading Python runtime (Pyodide)...
Add a "tax" column (10% of price) and a "total" column (price + tax). Print the DataFrame.
Loading Python runtime (Pyodide)...