hotshotgg

导航

2024年7月27日 #

DataFrame调用其他列内容,新建一列的两种方法,apply更高效

摘要: # Import cars data import pandas as pd cars = pd.read_csv('cars.csv', index_col = 0) # Use .apply(str.upper) #for lab, row in cars.iterrows() : #cars. 阅读全文

posted @ 2024-07-27 23:08 hotshotgg 阅读(10) 评论(0) 推荐(0) 编辑

pandas的for循环,iterrows方法,遍历标题和行内容

摘要: # 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.ite 阅读全文

posted @ 2024-07-27 22:40 hotshotgg 阅读(21) 评论(0) 推荐(0) 编辑