0% found this document useful (0 votes)
1 views

numpy_codes

The document provides a series of programming tasks related to array creation and manipulation using NumPy. It includes instructions on creating matrices, flattening arrays, extracting columns, reversing arrays, replacing values, calculating sums, finding maximum and minimum values, normalizing arrays, and performing dot products. Additionally, it covers generating random numbers and filtering values based on conditions.

Uploaded by

vkavasava
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1 views

numpy_codes

The document provides a series of programming tasks related to array creation and manipulation using NumPy. It includes instructions on creating matrices, flattening arrays, extracting columns, reversing arrays, replacing values, calculating sums, finding maximum and minimum values, normalizing arrays, and performing dot products. Additionally, it covers generating random numbers and filtering values based on conditions.

Uploaded by

vkavasava
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

Array Creation and Manipulation:

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?

You might also like