Exercise

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.

Instructions 1/3

undefined XP
    1
    2
    3
  • Start by creating the following dictionaries:

    • totals, which is an empty dictionary containing the totals for each month initialized to 0.
    • calendar, which is a dictionary containing the months (Jan, Feb, Mar) and corresponding numbers.