Write a NumPy program to move axes of an array to new positions. Other axes remain in their original order

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

Write a NumPy program to move axes of an array to new positions. Other axes remain in their original order

الأجوبة

import numpy as np
x = np.zeros((2, 3, 4))
print(np.moveaxis(x, 0, -1).shape)
print(np.moveaxis(x, -1, 0).shape)

Sample Output:

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

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

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