df.values.tolist
时间: 2024-04-24 18:26:57 浏览: 114
to.do-list
df.values.tolist()是将DataFrame对象转换为列表的方法。它会返回一个包含DataFrame中所有数据的二维列表。\[1\]在引用\[1\]中的代码示例中,df2是一个DataFrame对象,通过df2.values.tolist()将其转换为了一个名为list2的列表。因此,选项D说法错误,list2不是一维列表,而是二维列表。
#### 引用[.reference_title]
- *1* *3* [DataFrame和list之间相互转换:df.values.tolist()和pd.DataFrame()](https://blog.csdn.net/liujingwei8610/article/details/125438336)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* [pandas把Excel里某一列转化为list](https://blog.csdn.net/qq_36234441/article/details/126193467)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文