Skip to content

Tuple

A tuple is a sequence of values in parentheses, like (16, 5). It works like a Python list that stays the same after it's made.

pandas answers df.shape with a tuple: (16, 5) means 16 rows and 5 columns. You read its values by position, from 0, as you would in a list:

python
rows, columns = df.shape
df.shape[0]   # 16

A cell that ends with two values and a comma between them, like alt.__version__, pd.__version__, shows a tuple too.

Learn more

All terms