首页
Python
Java
前端
数据库
Linux
Chatgpt专题
开发者工具箱
losing专题
numpy切片不丢失维度为1时的维度(numpy slice without losing dimension)
numpy中实现矩阵的切片不丢失维度的几种方法 1. X[ :, ii ][ :, np.newaxis ] 或 X[ ii, : ][ np.newaxis, :]2. X[ :, ii, np.newaxis] 或 X[ np.newaxis, ii, :]3. X[ :, [ii] ] 或 X[ [ii], : ]4. reshape方法 在输出numpy矩阵的一维切片的时候
阅读更多...