25 lines
791 B
Python
25 lines
791 B
Python
|
||
import pandas as pd
|
||
|
||
file3034 = r'/root/.openclaw/workspace-xiaoyan/business_knowledge/L2单词表/30-34.xlsx'
|
||
df3034 = pd.read_excel(file3034)
|
||
|
||
print("="*60)
|
||
print("30-34.xlsx 文件结构:")
|
||
print(f"行数: {len(df3034)}")
|
||
print(f"列数: {len(df3034.columns)}")
|
||
print("\n列名:")
|
||
for i, col in enumerate(df3034.columns):
|
||
print(f" 列{i}: {col}")
|
||
|
||
print("\n前30行内容:")
|
||
print(df3034.head(30))
|
||
|
||
print("\n尝试找出包含单词的列...")
|
||
# 检查前几列中包含字母的内容
|
||
for col_idx in range(min(5, len(df3034.columns))):
|
||
col_data = df3034.iloc[:, col_idx].dropna()
|
||
# 统计包含字母的单元格数
|
||
has_letter = col_data.apply(lambda x: any(c.isalpha() for c in str(x))).sum()
|
||
print(f"列{col_idx}: 包含字母的单元格数 = {has_letter}")
|