| | |
| | | if not os.path.exists(combined_path): |
| | | print("拼接数据不存在") |
| | | return |
| | | |
| | | if code: |
| | | output_path = os.path.join(dir_path, f"big_buy_{code}.csv") |
| | | else: |
| | | output_path = os.path.join(dir_path, f"big_buy.csv") |
| | | |
| | | if os.path.exists(output_path): |
| | | print("路径已存在") |
| | | return |
| | | df = pd.read_csv(combined_path) |
| | | df_copy = df.copy() |
| | | if code: |
| | |
| | | grouped_result = grouped_result[grouped_result["TotalAmount"] > 500000] |
| | | # print(grouped_result) |
| | | # 遍历内容 |
| | | if code: |
| | | grouped_result.to_csv(os.path.join(dir_path, f"big_buy_{code}.csv"), index=False) |
| | | else: |
| | | grouped_result.to_csv(os.path.join(dir_path, f"big_buy.csv"), index=False) |
| | | print("保存成功") |
| | | grouped_result.to_csv(output_path, index=False) |
| | | print(f"保存成功,路径:{output_path}") |
| | | |
| | | |
| | | def extract_big_order_codes(dir_path): |