A to Z
Glossary
Every concept in this sheet, plus the smaller terms it uses. Select a concept to open its card.
C
- Copy-on-write
- Since pandas 3.0 every selection or method result behaves as a new object: changing it never changes the original. pandas only copies data when you actually modify it.
D
- DataFrame and Series
- A Series is one labelled column of values with a single dtype.
E
- Excel, SQL, JSON and Parquet
- pandas has a reader for each common source:
read_excelfor workbooks,read_sqlfor a database query,read_jsonfor JSON andread_parquetfor columnar Parquet files.
F
- First look at a dataset
head()shows the first rows,shapethe row and column count,info()each column's dtype and non-null count, anddescribe()summary statistics.
I
- iloc: select by position
df.iloc[rows, cols]selects by integer position, like Python lists: the end of a slice is excluded.
L
- loc: select by label
df.loc[rows, cols]selects by index labels and column names, and accepts boolean masks.
R
- read_csv
pd.read_csvreads a delimited text file into a DataFrame, guessing column types.
S
- Sampling rows
sample(n)orsample(frac=0.1)picks random rows;nlargestandnsmallestreturn the top or bottom rows by a column.- Selecting columns
- Square brackets with one name return a Series; with a list of names they return a DataFrame with those columns in that order.
T
- The index
- The index is the set of row labels.
W
- Why Parquet over CSV
- Parquet is a compressed, columnar file format that stores each column's type alongside the data.
- Writing data out
- Every reader has a writer:
to_csv,to_excel,to_parquet,to_sql.