7.1. Exercises

Chaining True/False

Practice Chaining

Instructions:
Running a coding exercise for the first time, could take a bit of time for everything to load. Be patient, it could take a few minutes.

When you see ____ in a coding exercise, replace it with what you assume to be the correct code. Run it and see if you obtain the desired output. Submit your code to validate if you were correct.

Make a plot using our Pokemon dataset by chaining actions sequentially.

Tasks:

  • Chain the following methods in the order specified.
  • First, rename the column capture_rt to capture_rate.
  • Then, create a new column named AD_total by adding the attack and defense columns from the pokemon dataset.
  • Save this in a dataframe object called plot_df.
  • Finally use .mark_circle() to plot AD_total on the x-axis and capture_rate on the y-axis.
  • Name this plot pokemon_plot.
  • Use a new line for each method.
Hint 1
  • Are you sure you are saving your dataframe as the correct object names?
  • Are you using the chaning commands in the correct order?
  • Are you using the .mark_circle() function?
Fully worked solution: