Python glossary
Each entry names one term, defines it, and links to the section that teaches it.
Accumulator#
A name that exists before a loop starts and carries a running answer across the passes. A count and a total are both accumulators, and keeping them side by side gives you an average out of one pass over the data.
Taught in: §12. Iterating over a list with for · §13. Filtering and the accumulator
Alias#
A second name for something that already exists. import polars as pl gives the module the alias pl, and b = a gives one list a second name, so a change made through b shows up through a.
Taught in: §9. Modules and import · §11. Lists
Argument#
A value you hand a function when you call it. The names in the definition are the parameters, and the values you pass in are the arguments.
Taught in: §8. Functions
Assertion#
A line that writes down what you expect to be true, so Python raises AssertionError the moment it stops being true. A row count, a total and a join cardinality are worth asserting on every dataset.
Taught in: §22. try / except, and assert
Assignment#
Putting a value into a name with =. It is an instruction, which is why freight = freight + 1 is legal.
Taught in: §1. Variables and values
Attribute#
A value you reach off a module or an object with a dot, such as math.pi.
Taught in: §9. Modules and import
Axes#
In matplotlib, the area of a chart the data is drawn in, which sits inside a figure. matplotlib's labeling calls are made on the axes, one call each for the title, the two axis names and the tick format. altair takes the same things as arguments instead.
Taught in: §29. A chart with labeled axes
Boolean#
The type that holds True or False, written bool. Both values start with a capital letter, and every comparison produces one.
Taught in: §2. Types · §3. Expressions and operators
Casting#
Converting a value to another type with int(), float() or str(), each of which hands back a new value of that type.
Taught in: §2. Types
Concatenation#
Joining two strings end to end. + concatenates two strings and adds two numbers, so "5" + "3" gives '53'.
Taught in: §2. Types
Conditional#
A block of code that runs only when a comparison is true, written with if, elif and else. Python checks the branches from the top and stops at the first one that is True.
Taught in: §4. Conditionals
Current directory#
The folder a running program treats as the default for any path that does not say otherwise, which is the folder it was launched from. Path.cwd() prints it.
Taught in: §20. Files and paths
Data structure#
One of the shapes that holds several values at once: a list, a tuple, a dictionary, a list of dicts, or a set. Choosing between them is a procedure with four questions, answered in order.
Taught in: §19. Choosing a data structure
DataFrame#
A table in polars or pandas: named columns, rows, one type per column.
Taught in: §23. Series and DataFrame
Deep copy#
A copy that goes all the way down, so the dictionaries inside a copied list are new dictionaries too. copy.deepcopy() makes one.
Taught in: §16. A list of dicts is a table
Default argument#
A value given to a parameter in the definition, which the caller may then leave out. Parameters carrying defaults go last.
Taught in: §8. Functions
Docstring#
A string on the first line of a function's body, which Python keeps and help() prints. Every help() you read is somebody else's docstring. Write the assumptions a reader cannot see, such as the grain the function expects, rather than restating the code.
Taught in: §8. Functions
Dictionary#
A collection that stores values by name instead of by position, written in braces as key: value pairs. One dictionary is one row of data.
Taught in: §15. Dictionaries
Dtype#
The type of one column of a Series or DataFrame, which polars and pandas both call a dtype. A date column arrives as Datetime, and a money column can arrive as Decimal.
Taught in: §23. Series and DataFrame
Exception#
An error Python raises when it cannot finish running your code, named on the last line of the traceback. IndexError, KeyError and FileNotFoundError are all exceptions.
Taught in: §10. Reading a traceback · §22. try / except, and assert
F-string#
A string with an f before the opening quote, where anything inside braces is evaluated and dropped into the text. A format after a colon decides how the value prints, so :.2f fixes two decimal places.
Taught in: §6. f-strings
Figure#
The whole image a matplotlib chart is drawn into, holding one or more axes.
Taught in: §29. A chart with labeled axes
Floor division#
Division that throws the remainder away, written //. 17 // 5 is 3.
Taught in: §2. Types
Function#
A calculation with a name, written with def, which takes parameters and hands a value back with return. You write it once and call it wherever you need it.
Taught in: §8. Functions
Grouping#
Collecting the rows that share a value in one column and computing one number per group, which .group_by().agg() does and SQL calls GROUP BY. The grouping key stays a column, and .value_counts() is the counting case of the same operation. pandas moves the key into the index instead.
Taught in: §13. Filtering and the accumulator · §26. .value_counts() and .group_by().agg()
Hashable#
The property a value has to have to be used as a dictionary key. A string, a number and a tuple are hashable, and a list is not.
Taught in: §14. Tuples
Identity#
Whether two names point at one object, which is the question is asks. == asks the other question, whether two objects hold equal values.
Taught in: §11. Lists
Immutable#
Unable to be changed after it is made. A string is immutable, so a method hands back a new string and leaves the original alone, and a tuple is immutable, so nothing can be assigned into a position.
Taught in: §5. Strings · §14. Tuples
Index#
A position in a string or a list, written in brackets and counting from zero, with a negative index counting back from the end. In pandas the word also names the label carried by each row of a Series or DataFrame. A polars row has no label, only a position.
Taught in: §5. Strings · §11. Lists · §23. Series and DataFrame
Iterate#
To run the same code once for each item in a collection, which is what a for loop does. Anything you can loop over this way is an iterable.
Taught in: §12. Iterating over a list with for
JSON#
A text format that nests dictionaries inside lists inside dictionaries, which is what almost every API hands back. json.load reads an open file and json.loads reads a string.
Taught in: §21. Parquet, CSV and JSON
Keyword argument#
An argument passed by naming its parameter at the call site, as in order_amount(440.00, freight_charge=16.75).
Taught in: §8. Functions
List#
A collection holding several values in one name, in the order you put them there, written in square brackets. A list can be changed in place.
Taught in: §11. Lists
List comprehension#
One line that builds a list out of another list, with the thing being collected at the front, the for in the middle, and any condition at the end. Find the for and read the middle first.
Taught in: §18. Comprehensions
Long#
The shape where each observation has its own row, which is what group_by, join, every plotting library and every database table want. unpivot turns a wide table into a long one.
Taught in: §28. Wide and long
Mask#
A Series of True and False with one entry per row, produced by a comparison on a column. Put it inside .filter() and you get the rows where it was True.
Taught in: §24. Selecting, filtering, sorting
Merge#
Lining two frames up on a shared key and getting one frame back, where on= names the key and how= decides which rows survive. polars calls it .join() and pandas .merge(). A merge onto the many side of a one-to-many relationship hands back more rows than either side had.
Taught in: §27. Merging two tables
Method#
A function written after a dot, belonging to the value in front of it, as in city_raw.strip().
Taught in: §5. Strings
Missing value (null)#
A cell with nothing in it. polars writes a missing value as null in every column type, and both group_by and .value_counts() keep those rows as a group of their own. pandas writes it as NaN, and as NaT in a column of dates, and leaves those rows out of groupby and .value_counts() until you ask for them.
Taught in: §25. A column of dates · §26. .value_counts() and .group_by().agg()
Module#
A file of code somebody already wrote, which import brings in. A file you wrote yourself is a module too, and you import it by the file's name without .py.
Taught in: §9. Modules and import
Mutable#
Able to be changed in place. A list is mutable, so .append() and assigning to a position change the list you already have.
Taught in: §11. Lists
Package#
A folder of modules that you install, such as polars. A ModuleNotFoundError means the package is missing from this environment or the name is misspelled.
Taught in: §9. Modules and import · §10. Reading a traceback
Parameter#
A name in a function's definition standing for a value the caller will supply.
Taught in: §8. Functions
Parquet#
A file format that stores what each column is, so a date comes back as a date and a number comes back as a number. pd.read_parquet is one line with nothing to declare.
Taught in: §21. Parquet, CSV and JSON
Path#
The address of a file. Path builds one out of parts with / between them, and the parts have names: .name, .stem, .suffix and .parent.
Taught in: §20. Files and paths
Return value#
What a function hands back to whoever called it. A function that prints and never returns has no return value, so the caller receives None.
Taught in: §8. Functions
Scope#
The region of code a name exists in. Parameters and anything created in a function body are local to that function and are gone once it returns, which is what scope means.
Taught in: §8. Functions
Series#
One column of a polars or pandas table. One column name in brackets gives a Series, and .select() gives a DataFrame.
Taught in: §23. Series and DataFrame
Set#
A collection holding each value once and keeping no order. It answers what the distinct values are and whether you have seen one before.
Taught in: §17. Sets
Shallow copy#
A copy of a collection that shares what is inside it. .copy() on a list of dictionaries gives a second list holding the same rows, so editing a row through either list changes it for both.
Taught in: §16. A list of dicts is a table
Slice#
A range taken out of a string or a list with two positions in brackets, reading as from the first up to but not including the second. Leave a side empty to mean from the start or to the end.
Taught in: §5. Strings · §11. Lists
Timestamp#
A value holding a day and a time, which is what datetime stores where date stores a day alone. A comparison against a bare date matches only the rows whose clock time is midnight.
Taught in: §7. Dates and times · §25. A column of dates
Traceback#
The block of text Python prints when it cannot finish running your code, ending in the name of what went wrong. Read the last line first.
Taught in: §10. Reading a traceback
Tuple#
A collection holding several values in order, written in parentheses, which cannot be changed after it is made. A tuple can be a dictionary key and a list cannot.
Taught in: §14. Tuples
Type#
What a value is, which decides what can be done to it. int, float, str and bool are the four this course uses most, and type() tells you what you are holding.
Taught in: §2. Types
Unpacking#
Giving each part of a tuple its own name by putting several names on the left of the =. A function written as return total, count hands back one tuple, which the caller unpacks.
Taught in: §14. Tuples
Variable#
A name that holds a value. These chapters say name, which is the word Python's own documentation uses, and variable is the same thing.
Taught in: §1. Variables and values
Wide#
The shape where each category has its own column, which is what a spreadsheet looks like and what a person reads easily. pivot_table builds it.
Taught in: §28. Wide and long
Last updated: Sunday, 9/27/2026