-1

For example, given a numpy array of dimensions (132, 82, 100), the resultant dimensions would be (132, 8200)

josh
  • 15
  • 6

1 Answers1

0

You can use reshape() function to change shape of the array. Using -1 as a parameter to reshape tells numpy to infer the dimension there.

arr = np.zeros((132, 82, 100))
arr = arr.reshape(*arr.shape[:-2], -1)
print(arr.shape)
# Out: (132, 8200)
yann ziselman
  • 1,882
  • 4
  • 21
Shubham
  • 1,215
  • 3
  • 12