Write a NumPy program to remove the first dimension from a given array of shape (1,3,4)
- برمجة بايثون
- 2021-09-13
- mhanasmh00489829403
الأجوبة
import numpy as np
nums = np.array([[[1, 2, 3, 4],
[0, 1, 3, 4],
[5, 0, 3, 2]]])
print('Shape of the said array:')
print(nums.shape)
print("\nAfter removing the first dimension of the shape of the said array:")
Sample Output:
Shape of the said array: (1, 3, 4) After removing the first dimension of the shape of the said array:
أسئلة مشابهة
القوائم الدراسية التي ينتمي لها السؤال