大佬们纯小白,运行调试出错了。
import csvimport os
import shutil
import pandas as pd
import numpy as np
from pandas import Series,DataFrame
data_sum =0
data_out =[]
path =os.lister('C:\\Users\\NRD\\Desktop\\sxh\\')
在这里提示了发生异常: AttributeError: module 'os' has no attribute 'lister'
for i in range(len(path)):
csv_data = pd.read_csv('C:\\Users\\NRD\\Desktop\\sxh\\'+path)
data = csv_data.iloc
data = data.values
a=0
b=0
if data == 0:
a+1
b+1
else:
b+1
a+0
PPER = a/b
lable = PPER
csv_df = pd.DataFrame(csv_data)
csv_df['PPER']=lable
csv_df.to_csv('C:\\Users\\NRD\\Desktop\\sxh\\'+path,index=None)
data_out = []
print("down!!!")
大佬们刚刚学python几天,老师让处理数据啥也不会啊,又出错了麻烦大佬们看看帮我改改。
把 os.lister 改成 os.listdir
页:
[1]