VITyarthi Python Essentials Module 11 Quiz Answer

Question 1

What will be the output of the following code? import numpy as np arr=np.array([10,20,30,40]) print(type(arr))?

  1. numpy.ndarray
  2. numpy array
  3. python array
  4. array
  1. numpy.ndarray

Question 2

What is the below statement suits for the Numpy array to list conversion? ​?

  1. list(array)
  2. array.list
  3. None
  1. list(array)

Question 3

How to find the type of NumPy array in Python??

  1. dtype
  2. type
  3. typei
  4. itype
  1. dtype

Question 4

Which of the following is used to count the number of elements in a Numpy array??

  1. count()
  2. size()
  3. shape()
  4. return()

2. size()

Question 5

Which of the following is the right way to import the Numpy module into your program??

  1. import numpy
  2. import numpy as np
  3. from numpy import *
  4. 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??

  1. max(array)
  2. array(max)
  3. array.max()
  4. 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])?

  1. print(a[5])
  2. print(a[-1])
  3. Both
  4. None

3. Both

Question 8

What will be the output of the ndarray.ndim attribute??

  1. Gives an object describing the type of the elements in the array
  2. Gives the number of dimensions of the array
  3. Gives the size of each element of the array in bytes
  4. None

2. Gives the number of dimensions of the array

Question 9

The function that returns the indices of the sorted elements.?

  1. np.argsort()
  2. sort(np)
  3. np.index()
  1. np.argsort()

If you find anything wrong in this Answer Key, feel free to reach us in the comment section.

Sharing Is Caring:

Leave a Comment