0

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

josh
  • 35
  • 1
  • 7

1 Answers1

1

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,952
  • 5
  • 21
Shubham
  • 1,310
  • 4
  • 13