python np array 转list
时间: 2023-10-04 16:14:00 浏览: 158
要将numpy数组转换为list,可以使用tolist()方法。例如,如果有一个名为arr的numpy数组,可以使用arr.tolist()将其转换为list。\[1\]这样做可以方便地在numpy数组和list之间进行数据类型的转换。
#### 引用[.reference_title]
- *1* *3* [python中numpy数组与list相互转换实例方法](https://blog.csdn.net/weixin_39655993/article/details/113960737)[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^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* [python中使用np.array()将list转换成Array的坑](https://blog.csdn.net/qq_41915623/article/details/120602512)[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^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文