May 2015
Beginner to intermediate
298 pages
5h 35m
English
Now let's examine using the Series and DataFrame objects, building up an understanding of their capabilities that will assist us in working with financial data.
A Series can be created by passing a scalar value, a NumPy array, or a Python dictionary/list to the constructor of the Series object. The following command creates a Series from 100 normally distributed random numbers:
In [2]: np.random.seed(1) s = pd.Series(np.random.randn(100)) s Out[2]: 0 1.624345 1 -0.611756 2 -0.528172 3 -1.072969 ... 96 -0.343854 97 0.043597 98 -0.620001 99 0.698032 Length: 100, dtype: float64
Individual elements of a Series can be retrieved using the [] operator ...
Read now
Unlock full access