Write a NumPy program to move the specified axis backwards, until it lies in a given position. Move the following 3rd array axes to first position. (2,3,4,5)

  • برمجة بايثون

Write a NumPy program to move the specified axis backwards, until it lies in a given position.
Move the following 3rd array axes to first position.
(2,3,4,5)

الأجوبة

import numpy as np
x = np.ones((2,3,4,5))
print(np.rollaxis(x, 3, 1).shape)

Sample Output:

(2, 5, 3, 4)
هل كان المحتوى مفيد؟

تبحث عن مدرس اونلاين؟

محتاج مساعدة باختيار المدرس الافضل؟ تواصل مع فريقنا الان لمساعدتك بتأمين افضل مدرس
ماهو التخصص الذي تبحث عنه؟
اكتب هنا...