Skip to content

pandas Basics

Glossary

100 terms from pandas Basics, in plain words, each with the chapter that teaches it.

A

Accessor
A bundle of methods on a Series for one kind of value: `.str` for text and `.dt` for dates. It runs the method on every value in the column at once.
Activate
Tells your terminal to use a virtual environment's Python and packages. You do it again in each new terminal, and `deactivate` turns it off.
agg
Builds a summary table with several named results per group. Each keyword is a new column name set to a (column, calculation) tuple, such as `sales=("total", "sum")`.
apply
Calls a function you wrote once for each value in a column and collects the results into a new Series. It runs ordinary Python per value, so it is slower than vectorized math.
astype
Converts a column to another dtype, such as `"int64"` or `"float64"`. It stops with an error if any value can't be converted.
Attribute
A value read with a dot and no parentheses, such as `df.shape`. Adding parentheses gives a TypeError.
Axes
matplotlib's name for one chart area. `.plot()` gives one back, and you store it in `ax` to set labels with `ax.set_xlabel()` and similar methods.
axis
An argument saying which direction to work in. `axis=1` means across the columns, giving one answer per row, while the default `axis=0` gives one per column.

B

between
Checks whether each value falls in a range, including both ends. It works on numbers and on ISO date text.
Boolean filter (mask)
A Series of True/False values, usually made by a comparison, that you put inside square brackets to keep only the True rows. For example `orders[orders["qty"] >= 3]` keeps the big orders.

C

cell
One block of code in a notebook. You run one cell at a time with Shift+Enter and its output appears right underneath.
Chained assignment
Changing values through two selections in a row, such as `orders["qty"][mask] = 5`. In pandas 3 it does nothing to the original table and gives a ChainedAssignmentError warning, so use one `.loc` instead.
columns
An attribute holding a DataFrame's column names in an Index. Assigning a new list to it renames every column at once.
concat
Stacks tables with the same columns one on top of the other, such as September's and October's orders. `ignore_index=True` renumbers the rows.
Copy-on-write
pandas 3's rule that any table you get by selecting from another behaves as a separate copy. Changing the new table never changes the original.
CSV
A plain-text file where each line is one row and values are separated by commas, with column names on the first line. Kettle & Crane's shop system exports orders this way.

D

DataFrame
pandas' table: several Series side by side, sharing one index, each column with its own dtype. You can build one from a dict of lists or a list of dicts.
describe
Gives quick statistics for each number column: count, mean, std, min, 25%, 50% (median), 75% and max. With `include="str"` it summarizes text columns instead.
dpi
How sharp a saved chart image is. At `dpi=200`, a 7-inch-wide chart comes out 1,400 pixels wide.
drop
Removes columns, as in `.drop(columns=[...])`. It gives back a new DataFrame, so you assign the result.
drop_duplicates
Removes repeated rows, keeping the first copy by default. `subset=` compares only some columns and `keep="last"` keeps the last copy.
dropna
Removes rows that have a missing value. `subset=` limits the check to certain columns.
Dtype
A column's data type, such as `int64`, `float64`, `str`, `bool` or `datetime64[us]`. Every value in a Series shares one dtype.
duplicated
Marks each row that is an exact copy of an earlier one. Summing the result counts the repeats.

E

encoding
How text characters are stored in a file. `read_csv` assumes UTF-8, and you may need `encoding="latin-1"` for old files or `"utf-8-sig"` so Excel shows accents like the é in Café.
ExcelWriter
Opens one Excel workbook for writing several sheets. Used with `with`, each `to_excel` call inside adds a sheet and the file is saved when the block ends.

F

fillna
Puts a value into the gaps. A dict lets you choose a different fill per column, as in `{"cost": 0.0}`.

G

Google Colab
A free service that runs notebooks on Google's computers in a web browser, so you install nothing. Its built-in pandas is version 2.2, so you upgrade it first.
groupby
Splits rows into groups that share a value, calculates something for each group, and combines the answers into one result. For example `orders.groupby("customer")["total"].sum()` gives sales per customer.

H

head
Shows the first rows of a table (five by default); `.tail()` shows the last rows. It's the quick way to look at a big table.
Histogram, bin
A chart that splits a range of values into equal-width bins and draws a bar for how many values fall in each. It shows how values are spread out.

I

idxmax
Gives the index label of the largest value in a Series, such as the name of the product that sold the most units.
iloc
Selects rows and columns by position, counting from 0, like list indexes. Its slices stop before the end.
import alias (pd)
`import pandas as pd` imports pandas under the short name `pd`, which almost everyone uses, so examples read `pd.read_csv(...)`.
Index
The labels of a Series's values or a DataFrame's rows. By default it is a `RangeIndex` numbered 0, 1, 2…, but it can hold names such as SKUs.
indicator
A `merge` option that adds a `_merge` column saying whether each row came from `left_only`, `right_only` or `both`. It's the quickest way to find rows that didn't match.
info
Prints a one-screen summary of a table: rows, columns, each column's dtype and its non-null count. A smaller non-null count is your first clue to missing values.
inplace
An option (`inplace=True`) on some pandas methods that changes the existing table directly instead of returning a new one. It is generally discouraged because it is rarely faster, and assigning the returned result back to the variable is the usual style.
isin
Checks whether each value is in a list, giving a True/False mask. It saves writing long chains of `|`.
isna
Gives True where a value is missing. Summing it counts gaps per column, and `.notna()` is the opposite.
ISO date
A date written year-month-day, like `2026-09-01`. It sorts in date order even as text, and pandas always reads it correctly.

J

JupyterLab
A notebook environment that runs in your browser but on your own computer. You install it with `pip install jupyterlab` and start it with `jupyter lab`.

K

Kernel
The Python program that runs a notebook's cells and keeps their variables in memory. `ipykernel` is the package that provides it.
Key
A column whose values identify rows and appear in both tables, such as `sku`. `merge` uses it to match rows.

L

Legend
The key on a chart saying which color is which series. pandas adds one when you plot a DataFrame with several columns.
Library
A large collection of ready-made modules that you install and import. pandas is a library for tables of data.
loc
Selects rows, and optionally columns, by label, as `.loc[rows, columns]`. A slice includes the end label, and it's also the safe way to change values: `df.loc[mask, "col"] = value`.

M

map
Replaces each value in a column using a dict as a lookup table. Values not in the dict become NaN.
matplotlib
Python's standard charting library, which pandas' `.plot()` uses. You import its `pyplot` module as `plt` to save and tidy charts.
Median
The middle value when the values are sorted. With an even count it is halfway between the two middle values.
merge
Matches rows of two tables on a key column and adds the second table's columns, like a spreadsheet lookup. `how=` (left, inner, right, outer) decides what happens to unmatched rows.
MultiIndex
An index with more than one level, which you get when grouping by two columns. `.reset_index()` turns the levels back into ordinary columns.

N

na_values
A `read_csv` argument listing extra text to treat as missing, such as `["n/a", "-"]`. The column then loads as numbers straight away.
NaN, NaT
Markers for a missing number (NaN) and a missing date (NaT). Summary methods skip them, but row-by-row math gives NaN for any row with a gap.
nlargest
Sorts and takes the top n rows by a column in one step; `nsmallest` takes the bottom n.
Notebook
A document made of cells of code. You run one cell at a time and see its output below, and variables stay in memory between cells.
NumPy
The library pandas uses to store and calculate numbers quickly. pip installs it along with pandas.
nunique
`.unique()` lists the different values in a column in order of first appearance, and `.nunique()` counts them.

O

object dtype
The dtype that can hold anything. A row mixing numbers and text has it, and older pandas shows text columns as `object` instead of `str`.
Open-source
Software whose code is published for anyone to read, use and improve, and which is free. pandas is open-source.
openpyxl
A package that lets pandas read and write `.xlsx` Excel files. Without it you get an ImportError.

P

Package
An installable bundle of modules, such as pandas.
parse_dates
A `read_csv` argument that converts listed columns to real dates as the file loads.
Path
Where a file is, starting from the folder you ran the program in, such as `data/orders.csv`. Forward slashes work on Windows too.
pct_change
Gives each value's change from the row before as a fraction: (this − last) ÷ last. The first row gets NaN.
pip
Python's package installer, which downloads packages from PyPI, the Python Package Index at pypi.org.
plot
Draws a chart from a Series or DataFrame using matplotlib: a line by default, or `kind="bar"`, `"barh"`, `"hist"` or `"scatter"`. `title=` sets the title and `figsize=(7, 3.5)` sets the width and height in inches.
PNG
An image file format. Charts are saved as PNG files so you can put them in reports or emails.
pyarrow
An optional Python package that pandas can use to store and process data, including text, more efficiently. It is not required for pandas to work.

Q

query
Takes a filter condition as a string, using column names directly and the words `and`, `or` and `not`. It is shorter, but your editor can't check inside the string.

R

read_csv
Loads a CSV file into a DataFrame. `usecols=` keeps only some columns, `nrows=` reads only the first rows, and `sep=` sets a separator other than a comma.
read_excel
Loads an Excel sheet into a DataFrame. `sheet_name=` picks a sheet, and `sheet_name=None` reads every sheet into a dict.
rename
Renames columns with `columns={old: new}`. It gives back a new DataFrame, so you assign the result.
reset_index
Renumbers the rows 0, 1, 2…, or turns index levels back into ordinary columns after a groupby. `drop=True` throws the old labels away.

S

savefig
`plt.savefig()` saves a chart as an image, `tight_layout()` fixes spacing so labels aren't cut off, and `close()` clears the chart so the next one starts fresh.
scatter chart
A chart with one dot per row for two number columns, used to see whether two measures move together.
Series
pandas' labeled column of values, all of one dtype. It acts like a list (ordered) and a dict (look up by label).
set_index
Makes a column into the index, so row labels differ from positions. After it, `.loc` and `.iloc` give different answers.
shape
An attribute giving a table's size as a (rows, columns) tuple.
SKU
Stock-keeping unit: the shop's short code for a product, such as `HE-5` for House Espresso 5 lb.
sort_values
Gives back a new DataFrame sorted by one or more columns, smallest first unless `ascending=False`. `.sort_index()` sorts back into index order.
Standard deviation
Roughly, how far values typically are from the mean. A small value means they are bunched together.
str accessor methods
Methods like `.str.strip()`, `.str.title()`, `.str.replace()` and `.str.contains()` that tidy and search text in every value of a column. They can be chained, repeating `.str` each time.
strftime
Formats dates as text using `%` codes (`%Y` year, `%m` month, `%d` day). `.dt.strftime("%Y-%m")` gives labels like `2026-09` for grouping by month, and the same codes tell `to_datetime` how to read text.
Suffixes
Endings added to clashing column names after a merge, `_x` and `_y` by default. `suffixes=("_paid", "_list")` picks clearer ones.
Summary methods
Series methods that boil all values down to one: `.sum()`, `.mean()` (the average), `.min()`, `.max()` and `.count()` (values that aren't missing). They skip NaN.

T

Terminal
A text window where you type commands: Terminal on macOS, PowerShell on Windows. `mkdir` makes a folder and `cd` moves into it.
Third-party
Written by other people and installed separately, not part of Python itself. pandas is a third-party package.
Timestamp
A single date and time in pandas. Subtracting two gives a gap, and `.dt.days` turns gaps into whole days.
to_csv
Writes a DataFrame to a CSV file, replacing any file of the same name. `index=False` leaves out the row labels, and `float_format="%.2f"` sets decimals.
to_datetime
Converts date text to real dates. `format=` says which part is the month, day and year, and `errors="coerce"` turns bad values into NaT.
to_excel
Writes a DataFrame to an `.xlsx` file using openpyxl. `sheet_name=` names the sheet.
to_numeric
Converts messy text to numbers. With `errors="coerce"`, anything that isn't a number becomes NaN instead of causing an error.
tolist
Turns a Series back into a plain Python list, which prints neatly and is handy for checking results.

V

validate
A safety check on `merge`. With `"many_to_one"`, many orders may share a SKU but each SKU must appear once in `products`, or the merge stops instead of quietly doubling sales.
value_counts
Counts how many times each value appears in a column, most common first. `normalize=True` gives proportions instead.
Vectorized
Applied to every value at once, without a loop. `prices * 1.1` raises every price by 10%.
Virtual environment
A private folder of installed packages for one project, so projects needing different versions can't break each other. You create it with `python -m venv .venv`.
VS Code
A code editor used for writing `.py` files and notebooks. Its Command Palette runs actions such as Python: Select Interpreter.

X

x-axis, y-axis
A chart's horizontal and vertical scales. In a line chart of daily sales, the dates go on the x-axis and the dollar values on the y-axis.