numpy_codes
numpy_codes
How do you create a 3x3 matrix filled with random integers between 1 and 100 using
NumPy?
Write a program to create a 5x5 identity matrix using NumPy.
How can you flatten a 2D array into a 1D array?
How do you extract the second column from a 3x3 NumPy array?
Write a program to reverse a 1D array.
How do you replace all even numbers in a NumPy array with -1?
How can you calculate the sum of all elements in a NumPy array?
Write a program to find the maximum and minimum values in a 2D array.
How do you normalize a NumPy array (scale its values between 0 and 1)?
What is the output of the following code?
arr = np.array([[1, 2], [3, 4], [5, 6]])
print(arr.T)
How do you find the dot product of two arrays in NumPy?
Write a program to find the inverse of a 3x3 matrix using NumPy.
How do you generate an array of 10 random numbers from a normal distribution?
Write a program to filter all values greater than 50 from a NumPy array.
How do you check if any or all elements in a NumPy array satisfy a given condition?
How do you replace all negative values in a NumPy array with 0?