This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## | |
## Wrap forecast auto.arima(..) and forecast(..) into a data.frame | |
## Embeds the forecast into the data.frame | |
## | |
## Allow passing an EndDate so that the forecast can start mid-actuals | |
## (helps with visualization and exaplantion) | |
## | |
## Usage: | |
## Forecast.df <- AutoArimaForecast(Monthly.df, # DataFrame with | |
## H = 6, # Predict 6 months forward |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Extracting date components from a Date column in Pandas using IPython | |
# Converting to DatetimeIndex is 100x faster than using DataFrame.apply() | |
import pandas as pd | |
dates = pd.DataFrame({"Date": pd.date_range(start="1970-01-01", end="2037-12-31")}) | |
print(dates.head()) | |
# Date | |
# 0 1970-01-01 | |
# 1 1970-01-02 |
NewerOlder