import csv
import os
import time

import numpy as np
import pandas as pd
root='/Users/yumingwu/Downloads/Stk_Day_QFQ/'
path =os.listdir(root)
path.sort()
num =45
day=time.strftime("%Y-%m-%d",time.localtime())

with open('./'+'打板盈利1'+'.csv','w',encoding='gbk',newline='') as csfile:
    writer =csv.writer(csfile)
    writer.writerow(['日期','盈利'])
    data = pd.read_excel('/Users/yumingwu/Desktop/数据/盈利/打板盈利.xlsx')
    data=data.groupby('买入时间')
    for i, item in data:
        writer.writerow([i, item['盈利'].sum()])





