Explorar o código

fix: Correct header row index in `insert_column` method

mrh (aider) hai 1 ano
pai
achega
8dfb978ed6
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  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] = ''
                 # 在表头行设置新列名
                 # 在表头行设置新列名
-                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}'")
             logger.info(f"成功在列 '{ref_column}' 的 '{position}' 插入新列 '{new_column_name}'")
             return df
             return df