Professional Documents
Culture Documents
Lab Plan 4
Lab Plan 4
Instructions:
Your submission will not get any credit if:
Task 5: Take this [1,2,3,4,5,6,7,8,9], calculate the square and save the result in new array.
Task 7: Write a NumPy program to create a 3x3 matrix with values ranging from 2 to 10.
Expected Output:
[[ 2 3 4]
[ 5 6 7]
[ 8 9 10]]
Task 8: Replace all odd numbers in array [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] with -1 without changing array.
Page 1 of 2
Dr. Sajida Parveen Fall-2022 CSE-3071
Task 10: Take two arrays: [[1,2,3] , [4,5,6]] and [[7,8,9],[10,11,12]], add/subtract them, save result in
new array, and print the result.
Task 11: Reshape this array [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] into 3 x 3
Task 13: Find the indexes where the value is even and odd in this array [1, 2, 3, 4, 5, 4, 4]
Task 14: Find the index [1,6,7,8,9] where the value 7 should be inserted to maintain ascending order
Page 2 of 2