【发布时间】:2018-02-19 08:54:56
【问题描述】:
我有一个excel文件,里面的数据如下:
Col_Title1 | Col_Title2 | Col_Title3 | Label
Row11 | Row12 | Row13 | 1
Row21 | Row22 | Row23 | 2
Row31 | Row32 | Row33 | 3
使用 pandas,我读到这个 excel 文件是这样的:
import pandas as pd
df = pd.read_excel(FOLDER_DOWNLOAD_LOCATION + '1.xlsx', sheet_name='Sheet1')
现在,我希望使用df 输出以下列表:
1. [[Row11, Row12, Row13], [Row21, Row22, Row23], [Row31, Row32, Row33]]
2. [1,2,3]
我不知道获得这些类型的列表输出的有效方法或好的技术。
附:我是编程新手,很抱歉提出此类问题。
【问题讨论】:
标签: python python-3.x list pandas dataframe