Table of Contents
ToggleQuestion 1
What will be the output of the following code? import numpy as np arr=np.array([10,20,30,40]) print(type(arr))?
- numpy.ndarray
- numpy array
- python array
- array
- numpy.ndarray
Question 2
What is the below statement suits for the Numpy array to list conversion? ?
- list(array)
- array.list
- None
- list(array)
Question 4
Which of the following is used to count the number of elements in a Numpy array??
- count()
- size()
- shape()
- return()
2. size()
Question 5
Which of the following is the right way to import the Numpy module into your program??
- import numpy
- import numpy as np
- from numpy import *
- All of the above
4. All of the above
Question 6
Which of the following syntax is used to find the maximum number in the given numpy array??
- max(array)
- array(max)
- array.max()
- None
3. array.max()
Question 7
The command to access the last element from the given array ‘a’ is — Import array as arr a=arr.array(‘d’, [2, 3, 4, 5, 6, 7])?
- print(a[5])
- print(a[-1])
- Both
- None
3. Both
Question 8
What will be the output of the ndarray.ndim attribute??
- Gives an object describing the type of the elements in the array
- Gives the number of dimensions of the array
- Gives the size of each element of the array in bytes
- None
2. Gives the number of dimensions of the array
Question 9
The function that returns the indices of the sorted elements.?
- np.argsort()
- sort(np)
- np.index()
- np.argsort()
If you find anything wrong in this Answer Key, feel free to reach us in the comment section.