[go: up one dir, main page]

0% found this document useful (0 votes)
9 views2 pages

Assignment 2

The document outlines a series of assignments related to NumPy programming, focusing on array manipulation and creation. Tasks include testing for zero elements, generating random numbers, creating matrices, and saving/loading arrays. The assignments aim to enhance understanding of NumPy functionalities and array operations.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views2 pages

Assignment 2

The document outlines a series of assignments related to NumPy programming, focusing on array manipulation and creation. Tasks include testing for zero elements, generating random numbers, creating matrices, and saving/loading arrays. The assignments aim to enhance understanding of NumPy functionalities and array operations.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Assignment:

1. Write a NumPy program to test whether none of the elements of a given array is zero.

2. Write a NumPy program to test whether any of the elements of a given array is non-zero.

3. Write a NumPy program to create an element-wise comparison (equal, equal within a tolerance) of two

given

4. Write a NumPy program to create an array of 10 zeros,10 ones, 10 fives.

5. Write a NumPy program to create an array of the integers from 30 to70.

6. Write a NumPy program to create a 3x3 identity matrix

7. Write a NumPy program to generate a random number between 0 and 1

8. Write a NumPy program to generate an array of 15 random numbers from a standard normal

distribution

9. Write a NumPy program to create a vector with values ranging from 15 to 55 and print all values

except the first and last.

10. Write a NumPy program to create a vector of length 5 filled with arbitrary integers from 0 to 10

11. Write a NumPy program to create a 10x10 matrix, in which the elements on the borders will be equal

to 1, and inside 0.

12. Write a NumPy program to create a 5x5 zero matrix with elements on the main diagonal equal to 1, 2,

3, 4, 5.

13. Write a NumPy program to create a 4x4 matrix in which 0 and 1 are staggered, with zeros on the main

diagonal.

14. Write a NumPy program to save two given arrays into a single file in compressed format (.npz format)

and load it.

15. Write a NumPy program to create a one-dimensional array of forty pseudo-randomly generated values.
Select
16. Write a NumPy program to extract all numbers from a given array which are less and greater than a

specified number.

You might also like