6.1. Exercises

Practicing Selecting Values

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.

Use the output of the following code chunk to help complete the next tasks.

Using our hockey_players data, try finding the following values and save them in their repective object names.

Tasks:

  • SaveThatcher Demko’s salary in an object nameddemko_paid.
  • How old is Zack MacEwen? Save it as object macewen_age.
  • What position does Jacob Markstrom play? Save this as object markstrom_position.
  • When was Justin Bailey born? Save it as an object named bailey_birth.
Hint 1
  • Are you using .loc[] to select the specific values?
  • Are you using single [] brackets?
  • Are you using “quotations”?
Fully worked solution:


Hint 1
  • Are you using .loc[] to select the specific values?
  • Are you using single [] brackets?
  • Are you using “quotations”?
Fully worked solution:


Hint 1
  • Are you using .loc[] to select the specific values?
  • Are you using single [] brackets?
  • Are you using “quotations”?
Fully worked solution:


Hint 1
  • Are you using .loc[] to select the specific values?
  • Are you using single [] brackets?
  • Are you using “quotations”?
Fully worked solution: