import pandas as pd
import sys

# 读取Excel文件
file_path = r'e:\project\python\工具\智慧校园\本部\消费数据\2024学生.xlsx'
df = pd.read_excel(file_path)

print("数据形状:", df.shape)
print("\n列名:")
for i, col in enumerate(df.columns):
    print(f"{i+1}. {col}")

print("\n前5行数据:")
print(df.head().to_string())

# 检查年级和班级相关字段
print("\n查找年级/班级相关字段...")
for col in df.columns:
    if any(keyword in str(col) for keyword in ['年级', '班级', 'grade', 'class', 'Grade', 'Class']):
        print(f"找到字段: {col}")
        print(f"唯一值: {df[col].unique()[:10]}")  # 只显示前10个唯一值

print("\n数据类型:")
print(df.dtypes)