From c285883d71ef8a362b012983dadc7ce4256b40f6 Mon Sep 17 00:00:00 2001 From: Administrator <admin@example.com> Date: 星期五, 23 五月 2025 01:52:07 +0800 Subject: [PATCH] bug修复 --- l2_data_parser.py | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/l2_data_parser.py b/l2_data_parser.py index 254c8c6..e96b4ed 100644 --- a/l2_data_parser.py +++ b/l2_data_parser.py @@ -276,8 +276,10 @@ 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'] + # 鎸塖ecurityID鍜孊uyNo鍒嗙粍 grouped = df.groupby(['SecurityID', 'BuyNo']) @@ -331,6 +333,9 @@ 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) # 鎸塖ecurityID鍜孊uyNo鍒嗙粍 -- Gitblit v1.8.0