Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Add column ( 1 ) In the video, Hugo showed you how to add the length of the country names of the brics DataFrame in
Add column
In the video, Hugo showed you how to add the length of the country names of the brics DataFrame in a new column:
for lab, row in brics.iterrows :
brics.loclab "namelength" lenrowcountry
You can do similar things on the cars DataFrame.
Instructions
XP
Use a for loop to add a new column, named COUNTRY, that contains a uppercase version of the country names in the "country" column. You can use the string method upper for this.
To see if your code worked, print out cars. Don't indent this code, so that it's not part of the for loop.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started