Skip to content

Latest commit

 

History

History
30 lines (16 loc) · 1.37 KB

File metadata and controls

30 lines (16 loc) · 1.37 KB

Numpy

  1. Write a NumPy program to create an array of 10 zeros.

  2. Write a NumPy program to create an array of 10 ones.

  3. Write a NumPy program to create a 3x3 matrix with values ranging from 0 to 8.

  4. Write a NumPy program to reverse an array (first element becomes the last).

  5. Write a NumPy program to extract all odd numbers from an array.

  6. Write a NumPy program to compute the sum of all elements, mean, and standard deviation of a given array.

  7. Write a NumPy program to create a 5x5 matrix with random values and find the minimum and maximum values.

  8. Write a NumPy program to create a 2D array with 1 on the border and 0 inside.

  9. Write a NumPy program to multiply two given matrices.

  10. Write a NumPy program to find the unique elements of an array.

  11. Write a NumPy program to extract the elements in the odd-numbered columns of a 2D array.

  12. Write a NumPy program to extract the elements in the even-numbered rows of a 2D array.

  13. Write a NumPy program to extract a subarray from a given array. The subarray should include the first 3 rows and the columns from index 1 to 4 (inclusive).

  14. Write a NumPy program to reverse the order of elements in each column of a 2D array.

  15. Write a NumPy program to create a diagonal matrix from a given 1D array. The elements below the diagonal should be zero, and the elements above the diagonal should be squared.