# Import cars data
import pandas as pd
cars = pd.read_csv('cars.csv', index_col = 0)
# Code for loop that adds COUNTRY column
for lab,row in cars.iterrows() :
cars.loc[lab,"COUNTRY"]=row["country"].upper()
# Print cars
print(cars)
# Import cars data
import pandas as pd
cars = pd.read_csv('cars.csv', index_col = 0)
# Code for loop that adds COUNTRY column
for lab,row in cars.iterrows() :
cars.loc[lab,"COUNTRY"]=row["country"].upper()
# Print cars
print(cars)
本文标题:2018-03-07
本文链接:https://www.haomeiwen.com/subject/hjfjfftx.html
网友评论