excel内容
1. 读取一列保存为list,项目名称为例:
运行结果
['51有色', '优生国际', '名片侠', '约珥传媒']2. 读取两列保存为list,项目名称和行业领域为例:
import pandas as pddef excel_one_line_to_list(): df = pd.read_excel("/Users/Devintern/Documents/pachong/ML_flow/pachong/qmp/files/投资事件导出20190303.xlsx", usecols=[1, 2], names=None) # 读取项目名称和行业领域两列,并不要列名 df_li = df.values.tolist() print(df_li)if __name__ == '__main__': excel_one_line_to_list()运行结果
[['51有色', '电子商务'], ['优生国际', '医疗健康'], ['名片侠', '工具软件'], ['约珥传媒', '文娱传媒']]点这里
保存list到excel