I am new to using NumPy and trying to work with arrays, tried building a 1D,2D and now a 3D array. But I wasn't sure why ndim thinks that this is a 2D array even though it has 3 rows
In [26]: c= array ([[1,1,1,1],[2,2,2,2],[3,3,3,3]])
In [27]: c
Out[27]:
array([[1, 1, 1, 1],
[2, 2, 2, 2],
[3, 3, 3, 3]])
In [28]: c.ndim
Out[28]: 2
This one shows up as a 3D array. How does the grouping work in a 3D array?
In [30]: d= array([[[1], [2]], [[3], [4]]])
In [31]: d
Out[31]:
array([[[1],
[2]],
[[3],
[4]]])
In [32]: d.ndim
Out[32]: 3