python处理支付宝账单数据
注意engine
import pandas as pd
from datetime import datetime
import time
def read_csv(from_path):
table = pd.read_csv(from_path, engine='python') ##选取表
return table
def write_csv(to_path,data):
data.to_csv(to_path,index=False)
if __name__ == "__main__":
start_time = time.time() # 开始时间
path = 'C:/Users/HP/Desktop'
file_name ='zhifubao_v1.csv'
from_path = path+"/"+file_name
print(from_path)
df = read_csv(from_path)
#df.head()
end_time = time.time() #结束时间
print("程序耗时%f秒." % (end_time - start_time))
print(df.head())
write_csv('C:/Users/HP/Desktop/v1_zhifubao.csv',df)