MCPcopy Index your code
hub / github.com/dataease/SQLBot / get_excel_column_count

Function get_excel_column_count

backend/common/utils/excel.py:3–12  ·  view source on GitHub ↗

获取Excel文件的列数

(file_path, sheet_name)

Source from the content-addressed store, hash-verified

1import pandas as pd
2
3def get_excel_column_count(file_path, sheet_name):
4 """获取Excel文件的列数"""
5 df_temp = pd.read_excel(
6 file_path,
7 sheet_name=sheet_name,
8 engine='calamine',
9 header=0,
10 nrows=0
11 )
12 return len(df_temp.columns)

Callers 2

innerFunction · 0.90
innerFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected