تم الحل ✓
categoryبرمجة وتطوير البرمجيات
schoolبكالوريوس
event_available2026-07-14
السؤال
Transcribed Image Text:
Problem 10 (7 points)
Given a 2-d array swap rows r and r+1, in place.
Use NumPy indexing to solve this problem. No for loops, please.
Have fun with it! You can solve this in one line.
In [194]: def np6(a, r):
# YOUR CODE HERE
raise NotImplementedError()
Expected output:
np6( np.arange(9).reshape(3,3), 1) =
array([[0, 1, 2],
[6, 7, 8],
[3, 4, 5]])
Use the cell below to test your function.
In [195]: np6( np.arange(6).reshape(3,2), 1)
ValueError
sinuthen innut 105 0219nbodafaav
in
Traceback (most recent call last).
check_circle الجواب — حل مفصل خطوة بخطوة
hourglass_top
🔒
الحل الكامل متاح للمشتركين
اشترك في أرشيف الأسئلة لعرض هذا الحل وآلاف الحلول المفصلة خطوة بخطوة من معلمين معتمدين.