# -*- coding: utf-8 -*- # !/usr/bin/env python execl_file = [ '113348986_202106_1.csv', '113348986_202106_02.csv', '113348986_202106_03.csv', '113348986_202106_04.csv', '113348986_202106_05.csv', '113348986_202106_06.csv' ] # total_count = 0 # for i in execl_file: # pay_count = 0 # if i < 10: # day = '0{}'.format(i) # else: # day = str(i) # 列求和 # print ttt.iloc[:,1:2].sum() # for i in ttt.index.values: # gateway = ttt.ix[i, 1] # if 'wechat-6417d4456f29257125ebf705-wxea00d7496605a3be-1480791292-agent' in gateway: # lines.append(ttt.ix[i, 0]) # s_bool = ttt[u'商户订单号'] == u'支付' # total_count += s_bool.sum() # # total = 0 # from os import path # # if path.exists(u'f:\\refund_withdraw.csv'): # ttt = pd.read_csv(u'f:\\refund_withdraw.csv') # groups = ttt.groupby('ownerId') # for name, group in groups: # print name, len(group) # result = {} # # ttt = pd.read_csv(u'E:\\code\\washpayer\\script\\transaction\\DealerIncomeProxy_his_5a561e9a8732d64c8181e406.csv') # for i in ttt.index.values: # _time = ttt.ix[i, 9][0:10] # if _time in result: # result[_time] += float(ttt.ix[i,4]) # else: # result[_time] = float(ttt.ix[i,4]) # # for _time, _value in result.iteritems(): # print '{},{}'.format(_time, _value) import pandas as pd import simplejson as json import os total = 0 split = {} file_type_list = ['csv'] def get_file_list(folder): filelist = [] #存储要copy的文件全名 for dirpath,dirnames,filenames in os.walk(folder): for file in filenames: file_type = file.split('.')[-1] if(file_type in file_type_list): file_fullname = os.path.join(dirpath, file) #文件全名 filelist.append(file_fullname) return filelist filelist = get_file_list(u'E:\\微弗智通\\年底对账\\京东\\12') # for i in ttt.index.values: # gateway = ttt.ix[i, 1] # if 'wechat-6417d4456f29257125ebf705-wxea00d7496605a3be-1480791292-agent' in gateway: # lines.append(ttt.ix[i, 0]) total = 0 for file in filelist: print file ttt = pd.read_csv(file) for i in ttt.index.values: order_no = str(ttt.ix[i, 6]).replace('="','').replace('""','') money = float(ttt.ix[i, 14]) if order_no[14:16] == 'PS' or order_no.startswith('WF4801') or order_no.startswith('PS'): print '{} = {}'.format(order_no, money) total += money