问题描述:
读取xlsx文件时,当用户名为空时,出现报错,无法根据用户名发送邮件,具体报错如下:
Error sending emails: Cannot mask with non-boolean array containing NA / NaN values
解决方案
转换了name的data type,从colummn到string
修改前:
# Get all unique user names from the 'Name' column
unique_names = df['Name'].dropna().unique()
修改后:转换了name的data type,从colummn到string
# Convert the 'Name' column to string data type
df['Name'] = df['Name'].astype(str)
# Get all unique user names from the 'Name' column
unique_names = df['Name'].dropna().unique()