Download our latest MNC Answers Application at Play Store. Download Now

NumPy - Python Package for Data MCQ solution | TCS Fresco Play

NumPy - Python Package for Data MCQ solution | TCS Fresco Play

Disclaimer: The primary purpose of providing this solution is to assist and support anyone who are unable to complete these courses due to a technical issue or a lack of expertise. This website's information or data are solely for the purpose of knowledge and education.

Make an effort to understand these solutions and apply them to your Hands-On difficulties. (It is not advisable that copy and paste these solutions).

All Question of the MCQs Present Below for Ease Use Ctrl + F with the question name to find the Question. All the Best!

If you found answer for any of the questions is wrong. Please do mention in the comment section, could be useful for others. Thanks!

NumPy python package for data 

Numpy python package for data mcq

numpy python package for data answer

numpy python package fresco play answer

numpy python package fresco pay 

_________________________


1. Which of the following characters are used to represent an unordered list?

All of those mentioned


2. Which of the following is a Scientific distribution of Python, used for Data Science?

All of those mentioned


3. It is possible to embed code snippets in markdown. State True or False?

TRUE


4. A line magic methods starts with ______ ?

%


5. A cell magic methods starts with ______ ?

%%


6. Which language is used to write documentation in a Jupyter Notebook?

MARKDOWN


7. Which of the following magic method list the history of input commands ?

%hist


8. Which of the following is used to know about an object in Ipython?

?


9. Which of the following is used to run system commands from Ipython?

!


10. What is the basic element of a Jupyter Notebook ?

Cell


11. What is the input of a cell magic method ?

Python code written in multiple lines of a single cell.


12. How to write the word 'Python' in markdown, to emphasize it in bold ?

**Python**


13. Which of the following is Ture about Numpy array data elements?

Data elements are of same type and of fixed size


14. Which of the following attribute determine the number of dimensions of a ndarray?

ndim


15. Which of the following attribute returns total number of bytes consumed by a ndarray?

nbytes


16. What does flags attribute of an ndarray return?

Memory layout of a ndarray


17. Which of the following attribute returns the number of elements in each dimension of a multi dimensional array?

num


18. What is the output of the following code?  

8

import numpy as np

x = np.array([[3.2, 7.8, 9.2],

             [4.5, 9.1, 1.2]], dtype='int64')

print(x.itemsize)


19. What is the output of the following code?

complex128

import numpy as np

y = np.array([3+4j, 0.4+7.8j])

print(y.dtype)


20. Which of the following method is used to read data from a text file?

loadtxt


21. What is the output of the following code ?

[[ 1. 0.] [ 0. 1.]]


22. Which of the following expressions return an Error?

2

1. np.random.rand(3, 2)

2. np.random.random(3, 2)

import numpy as np

z = np.eye(2)

print(y)


23. What is the output of the following code ?

[[0 0 0] [0 0 0]]

import numpy as np

x = np.array([[-1,0,1], [-2, 0, 2]])

y = np.zeros_like(x)

print(y)


24. Which of the following numpy method is used to simulate a binomial distribution?

binomial


25. What is the output of the following code ?

[ 1. 3.25 5.5 7.75 10. ] [1 6]

import numpy as np

print(np.linspace(1, 10, 5))

print(np.arange(1, 10, 5))

26. What is the output of the following code ?

(2,2)

import nupy as np

print(np.array(([1, 2], (3,4))).shape)


27. Predict the number of rows and columns of array x defined below?

4, 5

import numpy as np

x = np.arange(20).reshape(4, 5)


28. What is the output of the following code ?

[[0 1] [3 4]]

import numpy as np

x = np.arange(6).reshape(2,3)

y = np.hsplit(x,(2,))

print(y[0])


29. Which of the following numpy method is used to join arrays horizontally ?

hstack


30. What is the shape of array x defined below?  

Results in Error while creating

import numpy as np

x = np.arange(20).reshape(10, 10)


31. What is the output of the following code?

[[0 1]]

import numpy as np

x = np.arange(4).reshape(2,2)

y = np.vsplit(x,2)

print(y[0])


32. Array x is defined below. Determine the number of elements of it contains in second dimension?

15

import numpy as np

x = np.arange(90).reshape(3, 15, 2)


33. What is the output of the following code ?

[[0 1 4 5] [2 3 6 7]]

import numpy as np

x = np.arange(4).reshape(2,2)

y = np.arange(4, 8).reshape(2,2)

print(np.hstack((x,y)))


34. Which of the following numpy method is used to join arrays vertically ?

vstack


35. Which of the following method is used to convert the data type of an array?

astype


36. Which of the following method is used to check if a number is an infinite or not ?

isinfinite


37. What is the shape of Broadcasting array resulted from arrays with shapes (4, 1, 1,7) and (3, 1) ?

(4, 1, 3, 7)


38. What is the output of the following Code?

FALSE

import numpy as np

x = np.arange(4)

y = np.arange(4)

print(x == y)


39. What is the output of the following code ?

[ 2. 7. 12. 17.]

import numpy as np

x = np.arange(20).reshape(4,5)

print(x.mean(axis=1))


40. What is the output of the following Code?

[0 1 4 9]

import numpy as np

x = np.arange(4)

print(x**2)


41. Is Broadcasting feasible between two arrays whose shapes are (5, 8, 2) and (2,) ?

Yes


42. Is Broadcasting feasible between two arrays whose shapes are (5, 8, 1) and (4, 2) ?

No


43. What is the ouput of the following code?

FALSE

import numpy as np

x = np.arange(4).reshape(2,2)

print(np.isfinite(x))


44. What is the output of the following code?

[3 3 3 3]

import numpy as np

print(np.repeat(3, 4))


45. What is the output of the following code ?

[[0, 1], [2, 3]]

import numpy as np

x = np.arange(4).reshape(2,2)

print(x.tolist())


46. What is the outout of the following code ?

[[ 6 -6] [-6 6]]

import numpy as np

x = np.array([[-2],

              [2]])

y = np.array([[-3, 3]])

print(x.dot(y))


47. What is the outout of the following code ?

[[-5 1] [-1 5]]

import numpy as np

x = np.array([[-2],

              [2]])

y = np.array([[-3, 3]])

print(x + y)


48. What is the output of the following code?

[4 4 4 4 4]

import numpy as np

x = np.arange(30).reshape(5,6)

print(x.argmax(axis=1))


49. What is the shape of Broadcasting array resulted from arrays with shapes (9, 2, 1, 5) and (3, 1) ?

(9, 2, 3, 5)


50. What is the output of the following code?

[25 27]

import numpy as np

x = np.arange(30).reshape(3,5,2)

print(x[-1, 2:-1, -1])


51. What is the output of the following code?

[[0 1]]

import numpy as np

x = np.array([[0, 1], [1, 1], [2, 2]])

y = x.sum(-1)

print(x[y < 2, :])


52. What is the output of the following code?

[1 4 6]

import numpy as np

x = np.array([[1, 2], [3, 4], [5, 6]])

print(x[[0, 1, 2], [0, 1, 1]])


53. What is the output of the following code?

[1 2 4]

import numpy as np

x = np.array([[0, 1], [1, 1], [2, 2]])

print(x.sum(-1))


54. What is the output of the following code?

[11 15 19]

import numpy as np

x = np.arange(30).reshape(3,5,2)

print(x[1,::2,1])


55. What is the output of the following code?

[1 5 9]

import numpy as np

x = np.arange(12).reshape(3,4)

print(x[:,1])


56. What is the output of the following code?

[0 1 2 3]

import numpy as np

x = np.arange(4)

print(x.flatten())


57. What is the output of the following code?

[4 5 6 7]

import numpy as np

x = np.arange(12).reshape(3,4)

print(x[-2])


58. What is the output of the following code?

[14 15]

import numpy as np

x = np.arange(30).reshape(3,5,2)

print(x[1][::2][1])


59. What is the output of the following code?

[1 2 4]

import numpy as np

x = np.array([[0, 1], [1, 1], [2, 2]])

print(x.sum(-1))


60. What is the output of the following code?

(1, 4)

import numpy as np

x = np.arange(12).reshape(3,4)

print(x[-1:,].shape)


______________________________

If you have any queries, please feel free to ask on the comment section.
If you want MCQs and Hands-On solutions for any courses, Please feel free to ask on the comment section too.

Please share and support our page!