October 2019
Beginner to intermediate
674 pages
16h 43m
English
The slice operation behaves the same way as a NumPy array. Slicing can be done using the index numbers as shown in the following code:
# Slice till the 4th index (0 to 3)In [31]: stockPriceSeries[:4]Out[31]:GOOG 1200.00FB 62.57YHOO NaNTWTR 64.50Name: stockPrices, dtype: float64Logical slicing also works as follows:In [32]: stockPriceSeries[stockPriceSeries > 100]Out[32]:GOOG 1200.00AMZN 358.69AAPL 500.60Name: stockPrices, dtype: float64
Read now
Unlock full access