标签:统计 highlight top desktop xls replace panda 优秀 use
import pandas as pd df = pd.read_excel(‘C:\Users\60963\Desktop\Python成绩登记统计.xlsx‘) da = df.to_csv(‘C:\gg\Python_1.csv‘) da = pd.read_csv(‘C:\gg\Python_1.csv‘,index_col=0) da = da.replace(‘优秀‘,‘90‘) da = da.replace(‘良好‘,‘80‘) da = da.replace(‘合格‘,‘60‘) da = da.replace(‘不合格‘,‘0‘) da = da.fillna(0) print(da)
标签:统计 highlight top desktop xls replace panda 优秀 use
原文地址:https://www.cnblogs.com/youngTW/p/12971460.html