mirror of
https://gh-proxy.org/https://github.com/klinsmaya/SQLBot.git
synced 2026-11-08 01:06:59 +08:00
12 lines
286 B
Python
12 lines
286 B
Python
import pandas as pd
|
|
|
|
def get_excel_column_count(file_path, sheet_name):
|
|
"""获取Excel文件的列数"""
|
|
df_temp = pd.read_excel(
|
|
file_path,
|
|
sheet_name=sheet_name,
|
|
engine='calamine',
|
|
header=0,
|
|
nrows=0
|
|
)
|
|
return len(df_temp.columns) |