摘要: 1 import pandas 2 excel=pandas.read_excel(r'F:\pandas练习\成绩.xlsx',index_col='id',sheet_name='Sheet1') 3 temp=excel[['score1','score2']] 4 5 row_sum=tem 阅读全文
posted @ 2020-06-12 13:43 马蹄哒哒 阅读(228) 评论(0) 推荐(0)
摘要: 1 import pandas 2 excel=pandas.read_excel('name.xlsx') 3 4 #这里的n是指保留前几列,默认为0或者1,意思是全部保留,expand指是否扩展,默认为False 5 d=excel['name'].str.split(n=0,expand=Tr 阅读全文
posted @ 2020-06-12 12:19 马蹄哒哒 阅读(350) 评论(0) 推荐(0)
摘要: 1 import pandas 2 3 #定义数据效验函数 4 def score_validation(row): 5 try: 6 assert 0<=row['score']<=100 7 except: 8 print(row['sid'],row['name'],row['score']) 阅读全文
posted @ 2020-06-12 12:18 马蹄哒哒 阅读(158) 评论(0) 推荐(0)