Answers for "how to print shape of array in python"

1

list shape python

#consider as a example 
import numpy as np
l=[[1,2,3],[3,4,5]]
print(np.shape(l))  #this will give the shape of list
Posted by: Guest on April-18-2021
0

numpy shape

>>> a = np.array([(1, 2), (3, 4)], dtype=[('x', 'i4'), ('y', 'i4')])
>>> np.shape(a)
(2,)
>>> a.shape
(2,)
Posted by: Guest on September-12-2020

Code answers related to "how to print shape of array in python"

Python Answers by Framework

Browse Popular Code Answers by Language