The basics of the Series and DataFrame objects
Now let's examine using the
DataFrame objects, building up an understanding of their capabilities that will assist us in working with financial data.
Creating a Series and accessing elements
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
100 normally distributed random numbers:
In : np.random.seed(1) s = pd.Series(np.random.randn(100)) s Out: 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 ...