Show Menu
Cheatography

Pandas Cheat Sheet (DRAFT) by

A Python library used to manipulate dataframes.

This is a draft cheat sheet. It is a work in progress and is not finished yet.

Importing the Library

import pandas as pd

Creating a DataFrame

df = pd.Dat​aFrame(
{"a":[4, 5, 6], "​b":[1, 2, 3], "​c":[7, 8, 9]}
) 

print(df)

    a b c 
0   4 1 7 
1   5 2 8 
2   6 3 9
"­a", "­b", and "­c" are column names
0, 1, and 2 are indexes