np.reshape(-1, 2)
时间: 2023-10-09 14:15:29 浏览: 89
np.reshape(-1, 2)是一个numpy的函数调用,用于改变数组的形状。其中的参数-1表示根据数组的大小自动计算另一个维度的大小,而2表示目标数组每个子数组的大小为2。这个函数的作用是将原始数组按照每两个元素为一组重新排列,并生成一个新的数组。具体来说,它会将原始数组的元素按照行优先的顺序重新排列,并且每行有两个元素。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [numpy reshape](https://blog.csdn.net/ynkgyangxw/article/details/78464757)[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^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *2* [numpy.reshape( )用法总结](https://blog.csdn.net/qq_29373285/article/details/82753306)[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^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *3* [详解numpy.ndarray.reshape()函数的参数问题](https://download.csdn.net/download/weixin_38562725/14840309)[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^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
[ .reference_list ]
阅读全文