Working with datasets - combining datasets
In this example, we will be working with two datasets, df1
and df2
. You can print these both out in the console to see what they contain. You will notice that they contain different date formatting.
More specifically, df1
specifies the month by the name (e.g. 02-Feb-18
), whereas df2
specifies the month numerically (e.g. 06/01/2018
). Additionally, df1
uses a hyphen (-
) as a separator, whereas df2
uses a forward slash (/
) as a separator.
We will be combining these two datasets to form a consolidated forecast for the quarter. To do this, we will need to parse the different date formats of df1
and df2
.
This exercise is part of the course
Financial Forecasting in Python
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
____ = {'Jan': 0, 'Feb': 0, 'Mar': 0}
calendar = {'01': '____', '02': '____', '03': '____'}