Theory Questions
What is NumPy?
What is a NumPy array?
How can you create a NumPy array?
What is the difference between a NumPy array and a Python list?
How do you access elements of a NumPy array?
What is the shape of a NumPy array?
How can you perform element-wise operations on NumPy arrays?
How can you perform matrix multiplication using NumPy arrays?
What is broadcasting in NumPy?
How can you reshape a NumPy array?
Numpy array PPT
Programming Questions
Write a Numpy program to get the Numpy version and show the Numpy build configuration.
Write a NumPy program to get help with the add function.
Write a NumPy program to test whether none of the elements of a given array are zero.
Write a NumPy program to test if any of the elements of a given array are non-zero.
Write a NumPy program to test a given array element-wise for finiteness (not infinity or not a number).
Write a NumPy program to test element-wise for NaN of a given array.
Write a NumPy program to create an array of integers from 30 to 70.
Write a NumPy program to create a 3×3 identity matrix.
Write a NumPy program to generate an array of 15 random numbers from a standard normal distribution.
Output Questions
import numpy as np
arr = np.arange(5)
print(arr)
import numpy as np
arr = np.zeros(5)
print(arr)
import numpy as np
arr = np.arange(10, 20, 2)
print(arr)
import numpy as np
arr = np.ones((3, 4))
print(arr)
import numpy as np
arr = np.linspace(0, 1, 5)
print(arr)
import numpy as np
arr = np.array([[1, 2, 3], [4, 5, 6]])
print(arr.shape)
import numpy as np
arr = np.array([[1, 2], [3, 4]])
print(arr.reshape(4))
import numpy as np
arr = np.array([1, 2, 3])
result = np.sum(arr)
print(result)
import numpy as np
arr1 = np.array([[1, 2], [3, 4]])
arr2 = np.array([[5, 6], [7, 8]])
result = np.add(arr1, arr2)
print(result)
import numpy as np
arr = np.array([1, 2, 3])
print(np.max(arr))