4.1. Exercises
Column Arithmetic Questions
Question 1
What is the result if we multiply 2 columns together using the syntax
df[['Column_A']] * df[['Column_B']]
Creating a New Column
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.
For this exercise, we are going to create and drop some columns from our dataframe.
Tasks:
- Create a new column named
total_specialthat is the sum of columnsp_attackandsp_defense. - Save it, overwriting the dataframe named
pokemon. - Display the first 5 rows of the dataframe.