Skip to content

Latest commit

 

History

History
20 lines (13 loc) · 482 Bytes

62 numpy 怎么把一维数组变成二维数组.md

File metadata and controls

20 lines (13 loc) · 482 Bytes

Python100

把Python知识点整理成100道习题,知识点来自两本书:Python基础教程(第3版)和流畅的Python,以后会定期加入更多的习题,大家帮忙点个赞哈,点赞越多,更新越快~

numpy 怎么把一维数组变成二维数组

>>> a = numpy.arange(12)
>>> a
array([ 0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11])
>>> a.shape = 3, 4
>>> a
array([[ 0,  1,  2,  3],
       [ 4,  5,  6,  7],
       [ 8,  9, 10, 11]])