3.8 KiB
3.8 KiB
In [1]:
import pandas as pdIn [3]:
df = pd.read_excel("./2025级需要选课775+7.xlsx", usecols=['学号', '姓名', '性别'])In [ ]:
In [4]:
row_strings = set()
for _, row in df.iterrows():
row_str = f"{row['学号']}{row['姓名']}{row['性别']}"
row_strings.add(row_str)In [5]:
df.shapeOut [5]:
(782, 3)
In [6]:
len(row_strings)Out [6]:
782
In [9]:
df1 = pd.read_excel("./本部简易手环学生信息 .xls", usecols=['学号', '姓名', '性别'],skiprows=1)
row_strings1 = set()
for _, row in df.iterrows():
row_str = f"{row['学号']}{row['姓名']}{row['性别']}"
row_strings1.add(row_str)In [10]:
df1 = pd.read_excel("./本部蓝牙手环学生信息.xls", usecols=['学号', '姓名', '性别'],skiprows=1)
for _, row in df.iterrows():
row_str = f"{row['学号']}{row['姓名']}{row['性别']}"
row_strings1.add(row_str)In [11]:
row_strings - row_strings1 Out [11]:
set()
In [12]:
row_strings1 -row_strings Out [12]:
set()
In [13]:
len(row_strings1)Out [13]:
782
In [ ]: