Advanced·12 min·advanced · pandas · data
Pandas: tabular data
Pandas: tabular data
If NumPy is arrays, pandas is tables. The DataFrame is the central type — rows, named columns, mixed dtypes.
Essentials
df["col"]— a Series (one column)df[df["x"] > 5]— boolean filterdf.groupby("col").agg(...)— split-apply-combinedf.sort_values("col")·df.merge(other, on="key")pd.read_csv(io.StringIO(...))— parse CSVs
Pyodide reality
Pandas is large (~15 MB total with NumPy). First import is slow, then cached. Good for medium data (~100k rows); huge datasets are out of scope for a browser.
Try it
- Add a
countrycolumn todfand group by it. - Sort by year descending and take the top 3.