4 of 8
deleted 357 characters in body
Sid
  • 107
  • 2
  • 8

Shape of numpy array

What does shape of an array mean? Consider the following example:

import numpy as np

arr = np.array([[1]])
print(arr) # output: [[1]]
print(arr.ndim) # output: 2
print(arr.shape) # output: (1, 1)
Sid
  • 107
  • 2
  • 8