2.1. Exercises
Definitions
Coding Questions
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.
Your First Code!
Let’s try importing pandas and loading in our data.
Tasks:
- Import
pandasaspd. - Load in data named
canucks.csv. - Save the dataframe as
hockey_players. - Display the first 5 rows of the dataframe.
Your Second Code!
What are the column names of the hockey_players dataframe?
Tasks:
- Find the column names of
hockey_playersand save it ascolumns_hockey. - Display it.
What is the shape of the hockey dataframe?
Tasks:
- Find the shape of
hockey_playersand save the result ashockey_shape. - Display it.