Find length of 2D array Python

前端 未结 6 1643
一生所求
一生所求 2020-12-07 15:48

How do I find how many rows and columns are in a 2d array?

For example,

Input = ([[1, 2], [3, 4], [5, 6]])`

should be displaye

6条回答
  •  孤街浪徒
    2020-12-07 15:50

    You can also use np.size(a,1), 1 here is the axis and this will give you the number of columns

提交回复
热议问题