Session Ready
Exercise

Grouping all predictor insight graph tables

In the previous exercise, you constructed a function that calculates the predictor insight graph table for a given variable as follows:

pig_table = create_pig_table(basetable, "target","variable")

If you want to calculate the predictor insight graph table for many variables at once, it is a good idea to store them in a dictionary. You can create a new dictionary using dictionary = {}, add elements with a key using dictionary["key"] = value and retrieve elements using the key print(dictionary["key"]).

Instructions
100 XP
  • Create an empty dictionary pig_tables.
  • For each variable, create a predictor insight graph table.
  • For each variable, add this predictor insight graph table to the dictionary, with as key the name of the variable.
  • Print the predictor insight graph table of disc_time_since_last_gift.