October 2019
Beginner to intermediate
674 pages
16h 43m
English
Arithmetic and statistical operations can be applied, just like for a NumPy array. Such operations take place in a vectorized mode in a Series, just as in NumPy arrays, and do not require to be looped through:
# Mean of entire seriesIn [34]: np.mean(stockPriceSeries)Out[34]: 437.27200000000005# Standard deviation of entire seriesIn [35]: np.std(stockPriceSeries)Out[35]: 417.4446361087899
Elementwise operations can also be performed on a Series:
In [36]: serOut[36]:0 3.0639211 0.0974502 -1.6603673 -1.2213084 -0.9488735 0.4544626 0.586824dtype: float64In [37]: ser * serOut[37]:0 9.3876111 0.0094962 2.7568193 1.4915934 0.9003595 0.2065356 0.344362dtype: float64
An important feature of a Series is that data is automatically aligned ...
Read now
Unlock full access