尝试了好多方式,就这种觉得比较好用,个人觉得。
# 路径
file_path = "XXX.xlsx"
file_path_dir = os.path.dirname(file_path)
# sheet页
sheet_name = "one_sheet验证
# 列名,形成list
a_column_name1 = "股票"
df = pd.read_excel(file_path, sheet_name=sheet_name)
# 获取列数据形成list,列
a_links1 = df[a_column_name1].tolist()
for a_link in a_links1:
print(i)