Tutorial by Examples

A series is a one-dimension data structure. It's a bit like a supercharged array, or a dictionary. import pandas as pd s = pd.Series([10, 20, 30]) >>> s 0 10 1 20 2 30 dtype: int64 Every value in a series has an index. By default, the indices are integers, running fro...
import pandas as pd import numpy as np np.random.seed(0) rng = pd.date_range('2015-02-24', periods=5, freq='T') s = pd.Series(np.random.randn(len(rng)), index=rng) print (s) 2015-02-24 00:00:00 1.764052 2015-02-24 00:01:00 0.400157 2015-02-24 00:02:00 0.978738 2015-02-24 00:0...
Let us assume we have the following Series: >>> import pandas as pd >>> s = pd.Series([1, 4, 6, 3, 8, 7, 4, 5]) >>> s 0 1 1 4 2 6 3 3 4 8 5 7 6 4 7 5 dtype: int64 Followings are a few simple things which come handy when you are workin...
Pandas provides an effective way to apply a function to every element of a Series and get a new Series. Let us assume we have the following Series: >>> import pandas as pd >>> s = pd.Series([3, 7, 5, 8, 9, 1, 0, 4]) >>> s 0 3 1 7 2 5 3 8 4 9 5 1 ...

Page 1 of 1