Pandas Cheat Sheet

This provides a quick summary of Pandas commands.

Importing Pandas

Reading a CSV file into a data frame

Renaming columns in a data frame

In many data sets, the column names may contain spaces or special characters. Or the column names may be very long and hard to remember. It is helpful to rename the columns up front and then use the simpler names instead.

Accessing a column within a data frame

Selecting a subset of columns from a data frame

Observing a data frame

Handling missing data

Once you have observed the data you may discover that some rows are missing important information. Missing data often shows up as NaN. the following command will drop every row that contains an NaN.

Summarizing a data frame

Summarizing a column within a data frame

Sorting a data frame

Querying a data frame

Correlations

Plotting