October 2019
Beginner to intermediate
674 pages
16h 43m
English
Time series usually comes with a fixed frequency, for example, every microsecond, every second, every minute, and so on. These frequencies can be changed from one to another.
We can use the asfreq function to change frequencies, as shown in the following snippet:
In [131]: # Frequency conversion using asfreq
ibmTS.asfreq('BM')
Out[131]: 1959-06-30 448
1959-07-31 428
1959-08-31 425
1959-09-30 411
1959-10-30 411
1959-11-30 428
1959-12-31 439
1960-01-29 418
1960-02-29 419
1960-03-31 445
1960-04-29 453
1960-05-31 504
1960-06-30 522
Freq: BM, Name: closingPrice, dtype: float64
In this case, we just obtain the values corresponding to the last day of the month from the ibmTS time series. Here, bm stands for business month ...
Read now
Unlock full access