Python vocabulary
415 Python terms, from Novice to Master. Start with the basics or jump to a level.
Updated
Novice
- Arithmetic Operators
- The math symbols: + - * / // % **.
- Assignment
- Storing a value in a variable with a single =.
- Augmented Assignment
- A shortcut like += that updates a variable using its current value.
- Axis Label
- The words along a chart's axis that say what it measures and its unit, such as Recycled (tons).
- Bar Chart
- A chart that draws each amount as a bar whose height is the amount, so groups can be compared at a glance.
- Built-in Function
- A function that comes with Python, like print() and len(). No import needed.
- Comment
- A note for people reading the code, starting with #. Python ignores it.
- Comparison Operators
- Symbols like == and < that compare two values and answer True or False.
- Constant
- A value that should never change, named in ALL CAPS so everyone leaves it alone.
- Data Type
- What kind of value something is: whole number, decimal, text or True/False.
- elif
- "Else if": checks another condition when the ones above it were false.
- else
- Runs when none of the if or elif conditions above it were true.
- Escape Character
- A backslash that gives the next character a special meaning, like \n for a new line.
- Exponent
- The ** operator: raises a number to a power.
- Floor Division
- Dividing with // and dropping anything after the decimal point.
- f-string
- Text with values dropped straight in: f"Hi {name}".
- Grand Total
- The total of everything, across every group, which each group's share is divided by.
- if Statement
- Runs a block of code only when a condition is true.
- Indentation
- The spaces at the start of a line. Python uses them to group code into blocks.
- input()
- Waits for the user to type something and gives it back as a string.
- Interpreter
- The program that reads your Python code and runs it, line by line.
- len()
- Tells you how many items something has.
- Line Chart
- A chart that joins measurements taken in order, usually one per day or month, with a line, so the reader sees how a value changed over time.
- Logical Operators
- and, or and not: they combine True/False checks.
- Mean
- The average: add the values up and divide by how many there are; one very large value can pull it far.
- Median
- The middle value when the values are sorted, so one very large or small value can't pull it far.
- Missing Value
- A cell with no value in it: left blank, or typed as a word such as unknown that means nobody knew. pandas shows it as NaN.
- Modulo
- The % operator: the remainder left over after dividing.
- NameError
- The error Python stops with when it meets a name it doesn't know, often a typo such as prnt for print.
- Newline
- The invisible character that ends a line of text, written \n.
- None
- Python's way of saying "nothing here yet".
- Notebook
- A file of cells, code cells and Markdown cells, that keeps each cell's result saved under it; saved as an .ipynb file.
- Notebook Cell
- One block of a notebook, run on its own: a code cell holds Python and shows its result under it, a Markdown cell holds notes.
- Pie Chart
- A circle cut into slices, one per part of a whole; hard to read, because people compare angles poorly.
- print()
- Shows text or values on the screen.
- Python
- A popular, beginner-friendly programming language that reads almost like plain English.
- Python Install Manager
- python.org's tool for installing Python on Windows: it gives the py and python commands, and py install adds a version.
- Raw Data
- Data exactly as it was collected, before any cleaning; it's kept as it is, never written over, so the cleaning can be checked and run again.
- REPL
- Python's interactive prompt: type a line, press Enter, see the result right away.
- round()
- Rounds a number, to a whole number or a set number of decimal places.
- Running Total
- A number you keep adding to as you go through the rows, such as a store's sales so far; a dictionary can keep one for each group.
- Script
- A .py file of Python code you run from top to bottom to get a job done.
- snake_case
- Python naming style: all lowercase with underscores between words.
- String
- Text inside quotes, like "hello" or 'coffee'.
- String Concatenation
- Joining strings end to end with +.
- SyntaxError
- The error Python gives when it can't read the code at all, such as a missing quote or colon, so no line of the file runs.
- Traceback
- The error report Python prints when something goes wrong. Read it from the bottom up.
- Truthy and Falsy
- In an if, empty or zero values count as False (falsy); most others count as True (truthy).
- Type Conversion
- Turning a value into another type with int(), float() or str().
- type()
- Tells you the data type of a value.
- Variable
- A name that holds a value, like a labelled box.
- Whitespace
- Spaces, tabs and new lines. In Python, leading spaces decide which block a line is in.
Apprentice
- **kwargs
- Lets a function accept any number of keyword arguments, collected as a dictionary.
- *args
- Lets a function accept any number of positional arguments, collected as a tuple.
- append()
- Adds one item to the end of a list.
- Argument
- The actual value you hand to a function when you call it.
- AssertionError
- The error Python raises when an assert's condition is False; it carries the assert's message.
- Bin
- One range of values in a histogram, such as $5 to $10; its bar's height is how many values fall in it.
- break
- Stops a loop immediately.
- Breakpoint
- A mark on a line, the red dot in VS Code's margin, that pauses a program under the debugger before that line runs.
- Causation
- One thing making another happen. Showing it takes more than two things moving together, usually a test that changes one thing at a time.
- Command-Line Argument
- A word typed after a Python script's name when it's started, which the script reads from sys.argv or with argparse.
- continue
- Skips to the next pass of the loop.
- Data Analysis
- Answering questions with numbers from a table of data, such as which store sold the most last month.
- Debugger
- A tool, such as the one in VS Code's Python extension, that pauses a running program so you can step through it and look at its variables.
- def
- The keyword that starts a function definition: def, the function's name, parentheses and a colon, read "define".
- Default Parameter Value
- A value a parameter uses when the caller leaves that argument out.
- Dictionary
- Stores values under keys so you can look them up by name.
- Docstring
- A triple-quoted note under a function line that explains what it does.
- DPI
- Dots per inch: how many pixels each inch of a saved picture becomes, so 10 inches at 150 dpi is 1500 pixels wide.
- Duplicate Row
- A row that repeats an earlier one, in every column or in the columns that make two rows the same event.
- enumerate()
- Gives each item in a loop along with its position number.
- Execution Count
- The number beside a notebook cell, such as [4]: this was the fourth cell run since the kernel started.
- File Mode
- Tells open() what you plan to do: "r" read, "w" write, "a" add to the end.
- FileNotFoundError
- The error Python stops with when it's asked to read a file that isn't there, most often because the name is misspelled or the terminal is in another folder.
- fit()
- The scikit-learn method that trains a model on examples: model.fit(X, y) learns from the features X and the labels y.
- for Loop
- Repeats code once for each item in a collection.
- from … import
- Brings in just the names you want from a module.
- Function
- A named block of code, written once with def and run whenever a line calls its name with parentheses.
- Global Variable
- A variable created outside any function, readable anywhere in the file.
- head()
- A pandas method that shows a DataFrame's first rows, five unless you ask for another number; tail() shows the last.
- Histogram
- A chart of touching bars that counts how many values fall in each range, to show how one column's values are spread.
- Immutable
- Can't be changed after it is created, like a string or tuple.
- import
- Brings a module into your file so you can use it.
- Infinite Loop
- A loop that never stops because its condition never becomes false.
- info()
- A pandas method that lists every column of a DataFrame with its dtype and how many values are there, which shows the gaps.
- isna()
- A pandas method that answers True for each missing value and False for the rest; isna().sum() counts them.
- items()
- A dictionary method that gives each key with its value, one pair at a time, so a loop can name both halves.
- join()
- Glues a list of strings into one string with a separator between them.
- Kernel
- The Python program that runs a notebook's cells and remembers every name they make, in the order they ran.
- KeyError
- The error Python raises when a dictionary is asked for a key it doesn't have; its message names the missing key.
- Key-Value Pair
- One entry in a dictionary: a key and the value stored under it.
- Keyword Argument
- An argument passed by naming the parameter, like size="large".
- Legend
- A chart's small key that names each line or set of bars beside a sample of it; matplotlib draws it with ax.legend(), needed only when there's more than one.
- List
- An ordered collection in square brackets that you can add to and change.
- List Index
- An item's position in a list, counting from 0.
- Local Variable
- A variable created inside a function; it only exists inside that function.
- Long Format
- A table with one row for each value and one column for each kind of value, such as student, quiz and score: simple to filter and group.
- Marker
- The small shape a line chart draws at each point, such as a circle or a square, which tells lines apart without color.
- math Module
- A standard module with square roots, pi and other math tools.
- Membership Operator (in)
- in checks whether a value is inside a collection.
- min() and max()
- Give the smallest and largest value.
- Misleading Chart
- A chart that leaves the reader believing something false, often with every number right, through its axis, scale or colors.
- Module
- A Python file whose code you can use in another file.
- ModuleNotFoundError
- The error Python gives when an import names a package the Python running the code doesn't have installed.
- Mutable
- Can be changed after it is created, like a list or dictionary.
- NaN
- Read "not a number": pandas' mark for a missing value in a table.
- Negative Index
- An index that counts from the end: -1 is the last item.
- Nested List
- A list inside another list, like rows and columns.
- Nested Loop
- A loop inside another loop.
- nunique()
- A pandas method that counts how many different values a column holds.
- open()
- Opens a file so you can read from it or write to it.
- Outlier
- A real reading far from the usual ones, such as a storm's strongest gust; unlike a mistake, it's true, so it stays in the data.
- Parameter
- A name in a function definition for a value the function needs.
- pass
- Does nothing. A placeholder where Python needs at least one line.
- Percentile
- The value a given share of the data sits at or below: 90% of the rents are at or under the 90th percentile.
- Pivot Table
- A summary laid out as a grid: one column's values down the side, another's across the top, and a total, count or average in every square.
- pop()
- Removes an item from a list and hands it back (the last one by default).
- Positional Argument
- An argument matched to a parameter by its position in the call.
- predict()
- The scikit-learn method that uses a fitted model to guess the label for each row of new features: model.predict(X).
- PyPI
- The Python Package Index at pypi.org, the public library of packages that pip downloads and installs from.
- random Module
- A standard module for random numbers and picks.
- range()
- Makes a series of numbers, usually to repeat something a set number of times.
- read()
- Reads a whole open file into one string.
- read_csv()
- pd.read_csv loads a CSV file into a DataFrame; usecols, nrows and sep choose the columns, the rows and the separator.
- Recursion
- A function calling itself to solve a smaller piece of the same problem.
- Restart and Run All
- Stopping a notebook's kernel, then running every cell once from top to bottom, so the results are the ones the file really gives.
- Return Value
- The result a function hands back with return.
- Sample Size
- How many observations a number rests on, such as the 18 sessions behind a rate; the smaller it is, the further a few rows can move the number.
- savefig()
- A matplotlib Figure method that saves the whole chart, or page of charts, as an image file such as a PNG or SVG; the file's ending picks the format.
- Scatter Plot
- A chart with one dot for each row, one number across and one up, that shows whether the two numbers move together.
- scikit-learn
- The Python package for machine learning: ready-made models, tools to split and prepare data, and scores; installed as scikit-learn, imported as sklearn.
- Scope
- Where in the code a variable can be used.
- Set
- A collection with no duplicates and no set order.
- Short-Circuit Evaluation
- Python stops checking an and/or as soon as it knows the answer.
- Slicing
- Taking a piece of a list or string with [start:stop].
- sort()
- Puts a list in order, changing the list itself.
- sort_values()
- A pandas method that puts a table's rows in order by one column or several, with ascending= for each one's direction.
- sorted()
- Gives back a new sorted list and leaves the original alone.
- split()
- Breaks a string into a list of pieces.
- Standard Library
- The modules that come with Python, ready to import.
- strip()
- Removes spaces from both ends of a string.
- sum()
- Adds up all the numbers in a list.
- Tick Label
- One of the small labels along a chart's axis, such as a date or a number, that marks a place on the scale.
- Time Series
- Values recorded over time, one for each date or moment, such as daily sales or hourly temperatures.
- to_csv()
- A pandas method that saves a table as a CSV file; index=False leaves the row labels out.
- train_test_split()
- scikit-learn's function that shuffles rows and splits them into a training part and a test part; test_size sets the share held back.
- Truncated Axis
- A chart axis that starts above zero; on a bar chart it makes small differences look large.
- Tuple
- A list that can't be changed once made, written with round brackets.
- Tuple Unpacking
- Putting each item of a tuple into its own variable in one line.
- unique()
- A pandas method that lists each different value in a column once, in the order it first appears.
- upper() and lower()
- Give an all-caps or all-lowercase copy of a string.
- value_counts()
- A pandas method that counts how many rows hold each value of a column, most common first; normalize=True gives shares instead.
- ValueError
- The exception Python raises for a value of the right type that can't be used, such as float("two").
- while Loop
- Keeps repeating as long as its condition stays true.
- Wide Format
- A table that spreads one kind of value across many columns, such as a column for each quiz: quick for people to read.
- with Statement
- Opens something, like a file, and closes it for you when the block ends.
- write()
- Puts text into an open file.
- zip()
- Pairs up items from two or more lists so you can loop through them together.
Journeyman
- __init__ (Constructor)
- Runs automatically when an object is created and sets up its starting data.
- __init__.py
- A file that marks a folder as a Python package.
- __str__ and __repr__
- Control how an object looks when printed (__str__) and when debugging (__repr__).
- agg()
- A pandas method that works out several summaries for each group at once, such as a sum, a mean and a count, and hands them back as one table.
- annotate()
- A matplotlib method that writes a note on a chart with an arrow pointing at one value: xy is the point, xytext where the words sit.
- apply()
- A pandas method that runs a function, or a lambda, on every value of a column, one at a time.
- argparse
- Python's standard module that reads a script's command-line arguments into positional arguments, options and flags, checks them and writes a --help page.
- assert
- Checks that something is true, and stops with an error if not.
- astype()
- A pandas method that turns a column into another type, such as text into whole numbers, and stops if any value can't be converted.
- Attribute
- A piece of data that belongs to an object, reached with a dot.
- autoreload
- A notebook kernel's tool that reloads a changed module before each cell runs, turned on with %load_ext autoreload and %autoreload 2.
- Axes
- In matplotlib, one chart on a Figure: the area with the data and the two axes it's measured against.
- bar_label()
- The matplotlib Axes method that writes each bar's value at its end, given the bars ax.bar or ax.barh handed back.
- between()
- A pandas method that answers True for each value from a low number to a high one, both ends included, and False for a value outside it or a missing one.
- Boolean Mask
- A column of True and False answers, one per row, made by a comparison; df[mask] keeps the rows where it's True.
- Built-in Exceptions
- The error types Python already has, like ValueError and KeyError.
- capsys
- A fixture pytest has built in that catches what code prints while a test runs; capsys.readouterr().out is the printed text.
- Chained Comparison
- Several comparisons in one go, like 18 <= age < 65.
- Class
- A blueprint for making objects that bundle data with actions.
- Class Attribute
- Data shared by every object made from a class.
- Classification Report
- scikit-learn's printed table of precision, recall, F1 score and support for every class, with accuracy and averages below.
- Colorblind-Friendly Palette
- A set of colors chosen to stay different for most color-blind readers, such as matplotlib's tableau-colorblind10 style.
- concat()
- pd.concat stacks tables that share their columns, one under the other; ignore_index=True numbers the stacked rows from 0 again.
- Conditional Expression
- Picks one of two values in one line: this if condition else that.
- conftest.py
- A file pytest reads before it runs the tests in its folder, for set-up every test there shares, such as choosing matplotlib's Agg backend.
- Correlation
- How closely two columns move together, as a number from -1 to 1; near 0 means no straight-line pattern. It doesn't show that one causes the other.
- crosstab()
- pd.crosstab counts how often each combination of two columns' values happens; normalize="index" turns each row into shares.
- csv Module
- Python's built-in module for reading and writing CSV files: csv.reader and csv.DictReader read the rows, csv.writer and csv.DictWriter write them.
- Custom Exception
- Your own error type, named for exactly what went wrong.
- cut()
- pd.cut sorts numbers into labeled bands, such as budget, mid and premium, from a list of edges.
- DataFrame
- pandas' table: named columns, and a label for each row called its index, like one sheet of a spreadsheet inside a program.
- DataFrame.plot()
- The pandas method that draws a DataFrame or Series as a chart with matplotlib (kind= picks which) and hands back the Axes it drew on.
- Date Format Code
- A code such as %m (month), %d (day) or %Y (four-digit year) that describes one piece of how a date is written, as in "%m/%d/%Y".
- datetime Module
- A standard module for working with dates and times.
- Debugger (pdb)
- A tool that pauses your program so you can inspect it line by line.
- Deep Copy
- A copy of a collection and everything inside it, fully separate.
- describe()
- A pandas method that sums up each number column: count, mean, standard deviation, min, the quartiles and max.
- Dictionary Comprehension
- Builds a new dictionary in a single line.
- drop_duplicates()
- A pandas method that hands back the table without its repeated rows; subset names the columns to compare and keep which copy stays.
- dropna()
- A pandas method that hands back the table without the rows that have missing values, or only those missing the columns named in subset.
- dt accessor
- Read "dot d t": the date tools of a pandas date column, such as year, month, day_name() and hour, each working on every row at once.
- dtype
- Short for data type: the kind of value every row of a pandas column holds, such as int64, float64 or str.
- DummyClassifier
- A scikit-learn model that ignores the features and guesses by a simple rule, the most common class by default, to give a baseline.
- DummyRegressor
- A scikit-learn model that ignores the features and always guesses one number, the training average by default, to give a baseline.
- Dunder Method
- A method with double underscores, like __len__, that Python calls for you.
- duplicated()
- A pandas method that answers True for each row that repeats a row above it, on every column or on a subset.
- Encapsulation
- Keeping an object's data behind its methods so it's changed the safe way.
- Environment Variable
- A setting stored outside your code, the safe place for passwords and keys.
- Estimator
- scikit-learn's word for any object that learns from data with a fit method, such as LinearRegression or StandardScaler.
- Exception
- Python's way of reporting an error while a program runs.
- Exception Chaining (raise … from)
- Raising a clearer error while keeping the original attached (raise ... from).
- Exploratory Data Analysis
- Looking around a new dataset to learn what's in it before answering a question: its size, columns, gaps and odd values. Often shortened to EDA.
- Fairlearn
- A Python package for checking and improving a model's fairness, with MetricFrame for scores by group and gap measures such as demographic parity.
- Figure
- In matplotlib, the whole image that gets saved, like a sheet of paper with one or more charts drawn on it.
- fillna()
- A pandas method that puts a stand-in, such as "Unknown" or a median, into every missing value.
- filter()
- Keeps only the items that pass a test.
- finally
- Runs after try/except no matter what, for clean-up.
- fit_predict()
- The scikit-learn method that fits a model and hands back its answers for the same rows in one call, as KMeans uses it.
- glob()
- A pathlib method that finds the files in a folder whose names match a pattern, where * stands for any text, such as week-*.csv.
- groupby()
- The pandas method that sorts a table's rows into groups by a column's value, so each group can be totaled or averaged on its own.
- Higher-Order Function
- A function that takes or returns another function.
- Identity vs Equality (is vs ==)
- == checks equal values; is checks the very same object.
- iloc
- Read "i loc": pandas' way to pick rows and columns by position, counting from 0; a slice stops before its end.
- Imputation
- Filling in missing values with stand-ins worked out from the data, such as a median; the statistics-class name for it.
- Index
- The labels of a pandas Series or DataFrame, one for each value or row, used to find them; without labels of your own, they count from 0.
- Inheritance
- A new class starts with everything from another class, then adds or changes things.
- Instance
- One object made from a class, with its own data.
- ipykernel
- The package that lets VS Code run a notebook's cells with a virtual environment's Python; it goes in each project's requirements.txt.
- isin()
- A pandas method that answers True for each value found in a list, such as the categories boots or jackets.
- Iterable
- Anything you can loop over with for.
- joblib
- A Python package whose dump() and load() save a trained model to a file and read it back; scikit-learn's usual way to save models.
- json Module
- Turns Python data into JSON text and back.
- KMeans
- scikit-learn's k-means: KMeans(n_clusters=3) learns the centers with fit(), and labels_ says which cluster each row is in.
- Lambda Function
- A small, nameless one-line function.
- List Comprehension
- Builds a new list from another collection in a single line.
- Literal Type
- A type hint from Python's typing module that lists the only values allowed, such as Literal["dog", "cat", "rabbit"], matched exactly.
- loc
- pandas' way to pick rows and columns by their labels, as df.loc[rows, columns]; a label slice includes its end.
- logging Module
- A standard module that records what your program does, with levels.
- Magic Command
- A line that starts with %, such as %autoreload 2: an instruction to a notebook's kernel, not Python, so it works only in a notebook.
- Main Guard (if __name__ == "__main__")
- Runs code only when the file is run directly, not when imported.
- make_pipeline()
- scikit-learn's shortcut that builds a Pipeline from the steps alone, naming each one after its class, such as standardscaler.
- map()
- Runs a function on every item in a collection.
- matplotlib
- The Python package most charts are drawn with: a Figure holds one or more Axes, and each Axes is one chart.
- merge()
- A pandas method that joins two tables side by side by a key column they share, the job a spreadsheet's VLOOKUP does; how= says which rows that don't match are kept.
- Method
- A function that belongs to a class, called on an object with a dot.
- Method Chaining
- Writing several pandas steps as one expression, one method per line, each working on the table the step before it returned.
- Method Overriding
- A child class writing its own version of an inherited method.
- Namespace
- A set of names kept separate so they do not clash.
- NaT
- Read "not a time": pandas' mark for a missing date or length of time.
- nbconvert
- The Jupyter tool that converts a notebook to other formats: jupyter nbconvert --to html story.ipynb writes a web page anyone can open.
- nlargest()
- A pandas method that gives the rows with the largest values in a column, such as the three most-reviewed products.
- np.where()
- A NumPy function that gives each row one of two values: the first where a condition is True, the second where it's False.
- NumPy
- The Python library for fast math on arrays of numbers; pandas keeps every column's values in a NumPy array.
- NumPy Array
- NumPy's container (ndarray): many values of one type, packed side by side, that does math on all of them at once.
- OneHotEncoder
- scikit-learn's tool for one-hot encoding: it learns each column's categories with fit() and makes a 0-or-1 column for each.
- openpyxl
- The Python library that reads and writes Excel .xlsx files; pandas uses it behind read_excel, so it must be installed.
- OrdinalEncoder
- scikit-learn's tool that turns each category into a number, 0, 1, 2 and so on, in an order you can set, such as small, medium, large.
- Package
- A folder of related modules you can import from.
- pandas
- The Python package for tables of data: it reads a CSV file into a DataFrame, then sorts, filters, totals and charts it in a line or two.
- pathlib
- Python's standard module for file and folder paths: a Path holds an address in parts, joins them with / and reads a file's name, stem, suffix and parent.
- Pattern Matching (match/case)
- match/case: compares a value against patterns and runs the first that fits.
- PEP 8
- Python's official style guide for how code should look.
- pickle
- Python's built-in module that turns objects, a trained model included, into bytes and back; never load a pickle you don't trust.
- pip
- The tool that installs Python packages from the internet.
- pip-audit
- A command that checks a project's packages against a public list of known security holes, and names the version that fixes each.
- Pipeline
- A scikit-learn object that chains preparing steps and a model into one, so fit() and predict() run every step in order.
- pivot_table()
- The pandas method that builds a pivot table from index, columns, values and aggfunc, with fill_value for empty squares and margins for totals.
- plt.close()
- Closes a matplotlib figure so pyplot stops keeping it in memory; a test calls plt.close(fig) when it has read the chart.
- Polymorphism
- Different objects answering the same method call in their own way.
- predict_proba()
- The scikit-learn method that gives, for each row, the classifier's probability for every class, in the order of classes_.
- Private Attribute (_name)
- An attribute starting with _ that others should leave alone.
- pytest
- The most popular Python testing tool: test functions with plain assert.
- pytest.raises
- pytest's way to make sure code raises an error: a test passes only when the code inside with pytest.raises(...) raises that error.
- Quartile
- One of the values that cut sorted data into quarters: 25% of the values are at or below the first, half at or below the second (the median).
- raise
- Triggers an exception on purpose.
- raise_for_status()
- A requests response method that raises an HTTPError when the status code is from 400 to 599, and does nothing otherwise.
- Random Seed
- The starting number for Python's random numbers: the same seed gives the same "random" results on every run, which is what tests need.
- read_excel()
- pd.read_excel loads a sheet of an Excel workbook into a DataFrame; sheet_name picks the sheet and skiprows steps over title rows.
- read_json()
- pd.read_json loads JSON into a DataFrame, a row for each record; lines=True reads JSON Lines.
- Regular Expression
- A pattern for finding or checking text.
- rename()
- A pandas method that hands back a table with new column names, given a dictionary of old name to new name in columns=.
- requests
- The Python package most programs use to call web APIs: requests.get sends a request and gives back a response to read.
- requirements.txt
- A file listing the packages a project needs.
- reset_index()
- A pandas method that numbers a table's rows 0, 1, 2 again, moving the old row labels, such as a groupby's groups, into a column, or dropping them with drop=True.
- Ruff
- A fast Python linter and formatter in one tool: ruff check finds likely mistakes such as unused imports, and ruff format lays out every file the same way.
- self
- The object a method is working on, passed in automatically.
- Series
- One column of a pandas table, with the table's row labels; its methods, such as sum() and max(), work on the whole column at once.
- Series.map()
- A pandas method that, given a dictionary, gives each value the one the dictionary pairs with it, and NaN for a value it doesn't name.
- Series.replace()
- A pandas method that, given a dictionary, changes only the values the dictionary names and leaves every other value as it was.
- Set Comprehension
- Builds a new set from another collection in a single line, written in curly braces with one expression.
- Set Operations
- Combining sets: | both, & shared, - only in the first.
- set_index()
- A pandas method that makes a column, such as a product code, the table's row labels, so loc can find rows by it.
- set_ylim()
- A matplotlib method that sets where a chart's y-axis starts and ends; set_ylim(bottom=0) starts it at zero.
- Shallow Copy
- A new collection that still shares the items inside it with the original.
- Shared Axis
- One axis scale used by charts side by side, so their bars and lines compare by eye; plt.subplots(sharey=True) makes one.
- shutil
- Python's standard module for copying and moving files and folders, such as shutil.copy2 and shutil.move; read "shell utilities".
- SimpleImputer
- scikit-learn's tool that fills missing values with one value per column learned in fit(), such as the column's median.
- Split-Apply-Combine
- What a grouping does in three steps: split the rows into groups, work out one number for each group, and combine the answers into one result.
- sqlite3.IntegrityError
- The exception Python's sqlite3 module raises when a change would break a rule of the data, such as a repeated value in a UNIQUE column.
- Standard Deviation
- How far values usually sit from their average; describe() shows it as std.
- StandardScaler
- scikit-learn's tool that standardizes features: fit() learns each column's mean and standard deviation, transform() rescales with them.
- Step Into
- The debugger's command (F11 in VS Code) that goes inside the function the highlighted line calls and pauses on its first line.
- Step Over
- The debugger's command (F10 in VS Code) that runs the highlighted line, a function call included, and pauses on the next one.
- str accessor
- Read "dot s t r": the string tools of a pandas text column, such as strip, lower and contains, each working on every value at once.
- str.replace()
- A pandas text tool that swaps one piece of text for another in every value of a column, such as taking " lbs" off weights.
- str.split()
- A pandas text tool that cuts each value at a separator, a space by default; expand=True puts the pieces in columns and n limits the cuts.
- subplots()
- plt.subplots makes a Figure and its Axes in one call: one chart, or a grid such as 2 by 2 picked as axs[row, column].
- super()
- Calls a method from the parent class, usually to add to it.
- sys.argv
- The list of words a Python program was started with: the script's name first, then each word typed after it, all as strings.
- Test Fixture
- Shared setup, like sample data, that tests can use.
- Third-Party Library
- Code written by others that you install with pip.
- Tidy Data
- The textbook name for a table where each row is one observation and each column is one kind of value.
- Timedelta
- pandas' type for a length of time, such as 60 days 16 hours or 27 minutes 15 seconds; subtracting two dates gives one.
- Timestamp
- pandas' type for one date and time, such as 2026-08-03 07:40; a datetime64 column holds one per row.
- tmp_path
- A fixture pytest has built in: a new, empty folder for one test, where it can write files without touching the project.
- to_datetime()
- pd.to_datetime turns text into dates; format= says how they were written, and errors="coerce" makes each date it can't read NaT.
- to_excel()
- A pandas method that saves a table as an Excel workbook (.xlsx), using the openpyxl package.
- to_html()
- A pandas method that gives back a table as HTML text, ready to put in a web page; index=False leaves out the row numbers.
- to_numeric()
- pd.to_numeric turns a column of text into numbers; with errors="coerce", each value it can't read becomes NaN.
- to_period()
- A .dt method that turns each date into the period it falls in, such as its month, so rows can be grouped by month.
- to_timedelta()
- pd.to_timedelta turns text such as "0:27:15" (hours:minutes:seconds) into a Timedelta, a length of time.
- total_seconds()
- A Timedelta method (.dt.total_seconds() on a column) that gives the length of time as a number of seconds.
- try and except
- try runs code that might fail; except catches the error instead of crashing.
- Unit Test (unittest)
- Code that checks one function gives the right answer.
- Vectorized Operation
- Math done on a whole array or column at once, with no loop of your own, such as prices * 0.9.
- Version Pinning
- Writing a package's exact version in requirements.txt, such as pytest==9.2.0, so every computer installs the same one.
- Virtual Environment
- A project's own private set of installed packages.
- Walrus Operator
- The := operator: saves a value and uses it in the same line.
Freelancer
- __iter__ and __next__
- Methods that make your own class work in a for loop.
- Abstract Base Class (abc)
- A class you cannot use directly; it lists methods every child must write.
- Agg Backend
- The matplotlib backend that draws charts in memory with no window, so chart tests run on a computer with no screen.
- assert_frame_equal()
- pd.testing.assert_frame_equal compares two DataFrames in a test: column names, order, values and types, and says which column differs when they don't match.
- assign()
- A pandas method that hands back a new table with a column added or replaced, often with a lambda that gets the table at that step.
- async and await
- async def makes a pausable function; await is where it waits without blocking.
- asyncio
- The standard module that runs async code, doing many waits at once.
- category dtype
- A pandas column type for values from a short, fixed list, such as shirt sizes, stored once and optionally kept in an order of your own.
- Class Method (@classmethod)
- A method that belongs to the class, often another way to create objects.
- Closure
- An inner function that remembers the variables around it.
- ColumnTransformer
- A scikit-learn tool that prepares different columns in different ways, such as scaling the numbers and encoding the categories, then joins them.
- Context Manager
- Sets something up at the start of a with block and cleans up at the end.
- contextlib
- A standard module for writing your own context managers easily.
- Copy-on-Write
- How pandas 3 handles copies: a copy shares the data until one of them changes, so copying is cheap and a chained assignment changes nothing.
- Coroutine
- What an async def function returns: a task that can pause and resume.
- Counter
- Counts how many times each item appears.
- Dataclass
- A class for holding data; @dataclass writes __init__ and more for you.
- Decorator
- Wraps extra behavior around a function, applied with @name above it.
- defaultdict
- A dictionary that fills in a starting value for a new key automatically.
- deque
- A list built for quickly adding and removing at both ends.
- Duck Typing
- Python cares what an object can do, not what class it is.
- Enum
- A fixed set of named choices, like order statuses.
- Generator
- A function that hands out values one at a time with yield.
- Generator Expression
- Like a list comprehension in round brackets, producing values one at a time.
- Generic Type (TypeVar)
- Lets code work with any type while keeping in and out types linked.
- get_feature_names_out()
- The scikit-learn method that names each column a fitted preparing step hands back, such as species_cat and species_dog.
- get_params()
- The scikit-learn method that hands back a model's settings as a dictionary of names and values, such as max_depth: 3.
- GridSearchCV
- scikit-learn's grid search: it cross-validates every combination of the settings you list and refits the best on all the training rows.
- GroupShuffleSplit
- A scikit-learn splitter that keeps all the rows of one group, such as one customer, on the same side of the train-test split.
- httpx
- A Python package for web requests with the same shape as requests (get, status_code, json(), raise_for_status()), which can also send many requests at once.
- Iterator
- Gives out items one at a time with next() and remembers where it is.
- itertools
- A standard module of ready-made looping tools.
- Job Queue
- A separate program that keeps background work in a store of its own, runs it in workers apart from the web server and retries it, such as Celery or RQ.
- json_normalize()
- pd.json_normalize turns nested JSON data into a flat table: record_path names the list whose items become rows, meta the fields copied onto each.
- Logging Levels
- How serious a log message is, from DEBUG up to CRITICAL.
- make_column_transformer()
- scikit-learn's shortcut that builds a ColumnTransformer from (tool, columns) pairs, naming each part after its tool's class.
- melt()
- A pandas method that turns a wide table into a long one: the columns named in id_vars stay, and every other column becomes rows of a name and a value.
- Memoization (lru_cache)
- Saving a function's answers so repeat calls return instantly.
- Mocking (unittest.mock)
- Swapping a real part of the program for a fake one during a test.
- MultiIndex
- Row labels on two or more levels, such as a neighborhood and a pizza size, which pandas makes when it groups by two columns.
- Multiprocessing
- Runs work in separate processes so heavy calculations run in parallel.
- Mutable Default Argument
- A default like [] is shared by every call. Use None and make a new one inside.
- mypy
- A tool that checks your type hints and warns about type mistakes.
- Named Aggregation
- Writing agg as name=(column, summary), so each summary becomes a column with the name you chose, from the column you chose.
- Named Tuple
- A tuple whose items also have names.
- nonlocal
- Lets an inner function change a variable from the function around it.
- Optional (typing)
- In a type hint: the value can be that type or None.
- Parametrized Test
- One test run with several sets of inputs and expected answers.
- Partial Function (functools.partial)
- A copy of a function with some arguments already filled in.
- pipe()
- A pandas method that calls your own function with the table, so a step you wrote fits into a method chain.
- pivot()
- A pandas method that turns a long table into a wide one from index, columns and values, and stops with an error when two rows would fill one cell.
- Property (@property)
- Lets a method be used like an attribute, with no brackets.
- Protocol
- Describes what an object must be able to do, whatever class it is.
- pyproject.toml
- One file describing a Python project: name, version, packages it needs.
- Race Condition
- A bug where the result depends on which thread gets there first.
- resample()
- A pandas method that cuts a date index into periods, such as weeks or months, and summarizes each one, keeping the periods with no rows.
- set_params()
- The scikit-learn method that changes a model's settings by name, such as tree.set_params(max_depth=5), and hands back the model.
- SQLAlchemy
- Python's most used ORM and database toolkit: tables described as classes, and queries built in Python that it turns into SQL.
- Static Method (@staticmethod)
- A plain function kept inside a class; it uses neither self nor the class.
- str.extract()
- A pandas text tool that keeps the part of each value a regular expression's parentheses match, such as the digits in "about 30", and NaN where nothing matches.
- Styler
- What df.style makes: the same table drawn for people, with a format for each column, such as $20.00 or 97.2%, and the index hidden if you choose.
- Thread (threading)
- Lets part of a program run alongside the rest, handy while waiting on things.
- transform()
- A groupby method that works out a summary for each group and hands it back on every row of that group, lined up with the table.
- Type Hint
- A note saying what type a value should be, used by editors and tools.
- Union Type
- A type hint saying a value can be one of several types, like int | str.
- Unpacking Operator (* and **)
- In a call, * spreads a list into arguments and ** spreads a dictionary.
- Wheel (package build)
- A ready-to-install Python package file (.whl).
- yield
- Hands back one value from a generator and pauses until the next one is needed.
Master
- __init_subclass__
- Runs whenever a class inherits from yours; handy for tracking child classes.
- __new__
- Creates the object itself, just before __init__ fills it in.
- __slots__
- Lists the only attributes a class's objects may have, saving memory.
- Attribute Lookup (__getattr__)
- Runs when code asks for an attribute that doesn't exist.
- Bytecode
- The simpler instructions Python turns your code into before running it.
- Class Decorator
- A decorator placed on a class to change or register the whole class.
- Context Variable (contextvars)
- A value that belongs to the current task, so async tasks do not mix up values.
- CPython
- The standard Python you download from python.org, written in C.
- Data Model
- The dunder methods that let your objects work with len(), +, for and more.
- Descriptor
- An object that controls reading and setting an attribute; the machinery behind @property.
- Event Loop
- The asyncio engine that switches between tasks whenever one is waiting.
- Garbage Collector
- Frees memory reference counting misses, like objects pointing only at each other.
- Global Interpreter Lock (GIL)
- Lets only one thread run Python code at a time in standard Python.
- Interning
- Python keeps one shared copy of some values, like small numbers and short strings.
- Introspection (inspect)
- A program looking at itself while it runs: types, attributes, function arguments.
- Metaclass
- The class that builds classes, mostly used inside frameworks.
- Method Resolution Order (MRO)
- The order Python searches classes to find a method.
- Monkey Patching
- Replacing a function or method while the program runs.
- Reference Counting
- Python counts what points to an object and frees it when the count hits zero.
- Weak Reference
- Points to an object without keeping it alive.