I created a NumPy array where the elements are all empty arrays. I expected the shape to be (2,), but it returned (2, 0).
d = np.array([[],[]],dtype=object)
print(d,d.shape)
output:
[] (2, 0)
how to create np array with []
1
I created a NumPy array where the elements are all empty arrays. I expected the shape to be (2,), but it returned (2, 0).
d = np.array([[],[]],dtype=object)
print(d,d.shape)
output:
[] (2, 0)
how to create np array with []
1