| | |
| | | print(f"处理第{index}批次") |
| | | df["TradePrice"] = df["TradePrice"].apply(str_to_float) |
| | | df["SecurityID"] = df["SecurityID"].apply(code_format) |
| | | df = df[df["SecurityID"].str.startswith(("30", "00", "60"), na=False)] |
| | | # 计算成交金额 |
| | | df['TradeAmount'] = df['TradePrice'] * df['TradeVolume'] |
| | | |
| | | |
| | | # 按SecurityID和BuyNo分组 |
| | | grouped = df.groupby(['SecurityID', 'BuyNo']) |
| | |
| | | df = df[df["TickType"] == 'T'] |
| | | df["Price"] = df["Price"].apply(str_to_float) |
| | | df["SecurityID"] = df["SecurityID"].apply(code_format) |
| | | |
| | | df = df[df["SecurityID"].str.startswith(("30", "00", "60"), na=False)] |
| | | |
| | | # 计算成交金额 |
| | | df['TradeMoney'] = df["TradeMoney"].apply(str_to_float) |
| | | # 按SecurityID和BuyNo分组 |