Series and Dataframe

Series

  • A Series is a one-dimensinal object

  • It can hold any data type

  • Series consists of index label and value

  • Value can be accessed via index label

  • Index can be duplicated

Simple series

import pandas as pd

x = pd.Series([1,2,3])
x

index   values
--------------
0       1
1       2
2       3

x[0]
1

Define new index

Dictionary type series

Scalar value series

The value gets repeated for each of the indexed defined.

Dataframe

  • A Dataframe is a two dimensinal object that can have columns

  • Dictionaries, lists, series can be included

  • Most commonly used pandas object

Dataframe with Numpy

Get Summary of our data

Get cumulative sum

Referenced site

Last updated

Was this helpful?