不同 Excel Sheet(如区域A/区域B)都有同名机器人(如 `R01`),直接按 `robotName` 字段聚合会把不同工位的机器人合并成一台,导致工序序列混乱、统计数据错误。
不同 Excel Sheet(如区域A/区域B)都有同名机器人(如 R01),直接按 robotName 字段聚合会把不同工位的机器人合并成一台,导致工序序列混乱、统计数据错误。
robotName 在单个 Sheet 内唯一,但跨 Sheet 不唯一。缺乏全局唯一标识时,pandas groupby('robotName') 会静默合并同名记录。
区域A_R01 vs 区域B_R01sheet_prefix + robotName 作为联合主键# ❌ 直接按 robotName 合并
for sheet_name, df in sheets.items():
all_data.append(df)
result = pd.concat(all_data).groupby('robotName').agg(...)
# ✅ 带前缀合并
for sheet_name, df in sheets.items():
df['robot_id'] = sheet_name + '_' + df['robotName']
all_data.append(df)
result = pd.concat(all_data).groupby('robot_id').agg(...)sheet_prefix + robotName
echo "Verification passed: fix command exited 0"Expected Output: command completes without error, then Verification passed is printed. (Checks: sheet_prefix + robotName)