-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

Python for Finance

To make our time-series more manageable, it is a great idea to generate a date
variable. When talking about such a variable, readers could think about year (YYYY), year and month (YYYYMM) or year, month, and day (YYYYMMDD). For just the year, month, and day combination, we could have many forms. Using January 20, 2017 as an example, we could have 2017-1-20, 1/20/2017, 20Jan2017, 20-1-2017, and the like. In a sense, a true date variable, in our mind, could be easily manipulated. Usually, the true date
variable takes a form of year-month-day or other forms of its variants. Assume the date variable has a value of 2000-12-31. After adding one day to its value, the result should be 2001-1-1.
We could easily use the pandas.date_range()
function to generate our time-series; refer to the following example:
import pandas as pd import scipy as sp sp.random.seed(1257) mean=0.10 std=0.2 ddate =...
Change the font size
Change margin width
Change background colour