Pandas/Series & DataFrames 6 min

Series and DataFrames

The two containers everything else builds on.

seriesdataframedtypes

A Series is a labelled one-dimensional array; a DataFrame is a table of Series sharing one index. You usually build one from a dict of columns or read one from a file.

python · editable
loading editor…

Selecting one column with brackets gives a Series; a list of names gives a smaller DataFrame. Assigning to a new name adds a column.

python · editable
loading editor…

df.describe() and df.info() are the fastest way to get a feel for an unfamiliar table.