Răsfoiți Sursa

fix: Correct header row index in `insert_column` method

mrh (aider) 1 an în urmă
părinte
comite
8dfb978ed6
1 a modificat fișierele cu 1 adăugiri și 1 ștergeri
  1. 1 1
      function_calling/excel_processor.py

+ 1 - 1
function_calling/excel_processor.py

@@ -205,7 +205,7 @@ class ExcelProcessor:
                 # 将新列的表头行设置为空
                 df.iloc[:self.header_row, insert_index] = ''
                 # 在表头行设置新列名
-                df.iloc[self.header_row, insert_index] = new_column_name
+                df.iloc[self.header_row - 1, insert_index] = new_column_name
             
             logger.info(f"成功在列 '{ref_column}' 的 '{position}' 插入新列 '{new_column_name}'")
             return df