import pandas as pd
#读取excel
df = pd.read_excel("用户-模板.xlsx");
print("len(df):",len(df))
for i in range(len(df)):
    data ={}
    data["姓名"] = df['姓名'][i]
    data["年龄"]=df["年龄"][i]
    data["性别"]=df["性别"][i]
    data["手机号"]=df["手机号"][i]
    data["id"]=df["id"][i]
   print(data) if __name__ == '__main__': pass
首次使用报错:ImportError: Missing optional dependency 'openpyxl'.  Use pip or conda to install openpyxl.
首次使用python需要,安装pandas和openpyxl模块和依赖
pip install pandas
pip install openpyxl

 

相关文章:

  • 2022-02-06
  • 2021-07-22
  • 2021-08-23
  • 2022-12-23
  • 2021-06-26
  • 2021-11-23
猜你喜欢
  • 2022-01-05
  • 2022-12-23
  • 2021-10-16
  • 2021-05-23
  • 2021-08-30
  • 2021-12-04
  • 2022-02-01
相关资源
相似解决方案