Blog

MCQs

Disclaimer:

Educational Use Only:

The website links provided are to be used strictly for educational and knowledge-gaining purposes only.

No Misuse:

Do not misuse the links or the information contained therein for any commercial, illegal, or unethical activities.

Respect for Websites and Businesses:

Respect the intellectual property and business interests of the websites and their owners. Do not attempt to alter, copy, or redistribute content without proper authorization.

Acknowledge Value of Knowledge:

Recognize and value the knowledge and resources shared by these websites. Use the information responsibly and ethically.

No Endorsement:

The provision of these links does not imply endorsement of the linked sites, their content, or their products and services. Users are responsible for evaluating the suitability and accuracy of the information.

User Responsibility:

By accessing these links, you agree to use the information at your own risk and to comply with all applicable laws and website terms of use.


Overall MCQs for Reference

  1. Which object is fundamental in NumPy?
    a. Series
    b. DataFrame
    c. ndarray
    d. List
    Answer: c. ndarrayletsfindcourse​
  2. What does NumPy stand for?
    a. Numerical Python
    b. Number Python
    c. Numeric Package
    d. Numbers Power
    Answer: a. Numerical Pythonprojectpro+1​
  3. NumPy was created by:
    a. Guido van Rossum
    b. Travis Oliphant
    c. Wes McKinney
    d. Ross Ihaka
    Answer: b. Travis Oliphantletsfindcourse​
  4. Which method creates an array of zeros?
    a. np.zeros()
    b. np.empty()
    c. np.ones()
    d. np.array()
    Answer: a. np.zeros()interviewbit+1​
  5. Which function is used to reshape a NumPy array?
    a. reshape()
    b. shift()
    c. resize()
    d. format()
    Answer: a. reshape()sanfoundry+1​
  6. What is the default data type of NumPy arrays?
    a. int
    b. float
    c. object
    d. double
    Answer: b. floatfreshersnow+1​
  7. NumPy arrays are:
    a. Homogeneous
    b. Heterogeneous
    c. Mutable
    d. Static
    Answer: a. Homogeneousfinalroundai​
  8. Which function finds the mean of a NumPy array?
    a. np.mean()
    b. np.avg()
    c. np.sum()
    d. np.calc()
    Answer: a. np.mean()finalroundai+1​
  9. What does np.arange(5) generate?
    a.w3schools+4​
    b.rfaqs+3​
    c.sanfoundry+4​
    d.freshersnow+4​
    Answer: b.w3schools+3​
  10. Which attribute returns the shape of an array?
    a. .shape
    b. .size
    c. .len
    d. .format
    Answer: a. .shapeprojectpro+1​
  11. What is broadcasting in NumPy?
    a. Element-wise multiplication
    b. Implicit expansion of arrays
    c. Data copying
    d. Array slicing
    Answer: b. Implicit expansion of arraysupesonline+1​
  12. How can you access the element at second row, third column of a 2D array ‘arr’?
    a. arrfreshersnow+1​
    b. arr(1,2)
    c. arrsanfoundry+1​
    d. arrfreshersnow​
    Answer: c. arrrfaqs+2​
  13. Which function is used to concatenate arrays in NumPy?
    a. np.concat()
    b. np.append()
    c. np.concatenate()
    d. np.merge()
    Answer: c. np.concatenate()finalroundai+1​
  14. What does np.random.seed(42) do?
    a. Generates random number 42
    b. Sets the random seed for reproducibility
    c. Initializes zeros array
    d. Updates the array’s shape
    Answer: b. Sets the random seed for reproducibilityrfaqs​
  15. Which module in NumPy deals with masked arrays?
    a. np.mask
    b. np.ma
    c. np.arraymask
    d. np.data
    Answer: b. np.maupesonline​
  16. What function generates a range of evenly spaced values?
    a. np.range()
    b. np.linspace()
    c. np.spaced()
    d. np.arange()
    Answer: b. np.linspace()letsfindcourse+1​
  17. Which of the following finds unique values in an array?
    a. np.unique()
    b. np.set()
    c. np.find()
    d. np.distinct()
    Answer: a. np.unique()projectpro+1​
  18. Which method returns the number of elements in an array?
    a. .size
    b. .count
    c. .length
    d. .num
    Answer: a. .sizeinterviewbit+1​
  19. What is the output type of np.dot()?
    a. Scalar
    b. Array
    c. List
    d. Set
    Answer: b. Arrayrfaqs+1​
  20. To transpose a 2D array, use:
    a. arr.transpose()
    b. arr.fliplr()
    c. arr.reverse()
    d. arr.T
    Answer: d. arr.Tfinalroundai+1​
  21. Which function is for element-wise addition of arrays?
    a. np.add()
    b. np.sum()
    c. np.append()
    d. np.concat()
    Answer: a. np.add()finalroundai​
  22. How can missing values be handled in NumPy?
    a. Using NaN and np.isnan()
    b. Dropping rows
    c. Filling with zero
    d. Renaming columns
    Answer: a. Using NaN and np.isnan()upesonline+1​
  23. Which function loads an array from disk?
    a. np.load()
    b. np.import()
    c. np.read()
    d. np.fromfile()
    Answer: a. np.load()projectpro+1​
  24. Which function saves NumPy arrays to disk?
    a. np.save()
    b. np.store()
    c. np.export()
    d. np.dumps()
    Answer: a. np.save()projectpro+1​
  25. What does np.eye(3) create?
    a. 3×3 identity matrix
    b. 3×3 zeros
    c. 3×3 ones
    d. 3×3 random
    Answer: a. 3×3 identity matrixletsfindcourse+1​
  26. What function is used for statistical correlation in NumPy?
    a. np.corrcoef()
    b. np.covar()
    c. np.core()
    d. np.corr()
    Answer: a. np.corrcoef()finalroundai​
  27. Which method changes the dtype of a NumPy array?
    a. astype()
    b. dtype()
    c. typecast()
    d. convert()
    Answer: a. astype()letsfindcourse+1​
  28. How do you create a 3D array in NumPy?
    a. np.array([…])
    b. np.zeros((3,3,3))
    c. np.ones((3,3,3))
    d. All of the above
    Answer: d. All of the aboveletsfindcourse+1​
  29. Which function produces random integers in NumPy?
    a. np.randint()
    b. np.random.randint()
    c. np.random_int()
    d. np.int()
    Answer: b. np.random.randint()finalroundai+1​
  30. What is the purpose of the “np.fromiter()” function?
    a. Create array from iterator
    b. Create array from file
    c. Alias for np.array()
    d. Generates random array
    Answer: a. Create array from iteratorupesonline​
  31. Which function makes a deep copy of an array?
    a. np.copy()
    b. np.clone()
    c. np.deepcopy()
    d. np.mdeep()
    Answer: a. np.copy()projectpro+1​
  32. Which function returns the maximum value in an array?
    a. np.max()
    b. np.maximum()
    c. np.amax()
    d. All of the above
    Answer: d. All of the abovefinalroundai​
  33. What is stride in NumPy?
    a. Step-size to traverse array
    b. Array shape
    c. Data type
    d. Index value
    Answer: a. Step-size to traverse arrayfinalroundai​
  34. How would you flatten a 2D array into 1D?
    a. arr.flatten()
    b. arr.ravel()
    c. arr.reshape(-1)
    d. Any of the above
    Answer: d. Any of the aboveprojectpro+1​
  35. Which method calculates the standard deviation of array?
    a. np.std()
    b. np.deviate()
    c. np.variance()
    d. np.stddev()
    Answer: a. np.std()projectpro+1​
  36. Which function stacks arrays vertically?
    a. np.vstack()
    b. np.hstack()
    c. np.dstack()
    d. np.stackvertical()
    Answer: a. np.vstack()projectpro+1​
  37. What does np.isnan() test for?
    a. NaN values
    b. Zeros
    c. Negative values
    d. Infinity
    Answer: a. NaN valuesupesonline+1​
  38. Which of the following is not a valid NumPy function?
    a. np.array()
    b. np.arr()
    c. np.linspace()
    d. np.arange()
    Answer: b. np.arr()letsfindcourse+1​
  39. What does np.argsort() return?
    a. Sorted array indices
    b. Sorted array
    c. Array length
    d. Unique values
    Answer: a. Sorted array indicesfinalroundai+1​
  40. What is the output of np.zeros((2,3))?
    a. 2×3 matrix of zeros
    b. List of 6 zeros
    c. Array of ones
    d. 3×2 matrix of zeros
    Answer: a. 2×3 matrix of zerosinterviewbit+1​
  41. Which attribute gives the number of dimensions?
    a. ndim
    b. size
    c. shape
    d. dim
    Answer: a. ndiminterviewbit+1​
  42. np.arange(10,20,2) outputs:
    a.includehelp+4​
    b.gyansetu+4​
    c.geeksforgeeks+3​
    d.datacamp+4​
    Answer: a.devopsschool+5​
  43. What does np.full((3,3), 7) create?
    a. 3×3 matrix of sevens
    b. 1D array of sevens
    c. Empty array
    d. Zeros array
    Answer: a. 3×3 matrix of sevensprojectpro+1​
  44. Which function removes duplicate elements from an array?
    a. np.unique()
    b. np.duplicate()
    c. np.remove()
    d. np.distinct()
    Answer: a. np.unique()finalroundai+1​
  45. How can you reverse an array?
    a. arr[::-1]
    b. arr.reverse()
    c. np.flip(arr)
    d. Either a or c
    Answer: d. Either a or cprojectpro+1​
  46. Which function surfaces minimum value in array?
    a. np.min()
    b. np.minimum()
    c. np.amin()
    d. All of the above
    Answer: d. All of the abovefinalroundai​
  47. What does np.savetxt() do?
    a. Saves array to text file
    b. Reads array from text
    c. Merges arrays
    d. Counts array lines
    Answer: a. Saves array to text filefinalroundai​
  48. Which attribute gives item size of an array?
    a. itemsize
    b. items
    c. sizeof
    d. size
    Answer: a. itemsizeinterviewbit​
  49. How does NumPy handle different-dimension arrays in operations?
    a. Broadcasting
    b. Padding
    c. Copying
    d. Slicing
    Answer: a. Broadcastingupesonline+1​
  50. What is the output of np.ones((2,2), dtype=int)?
    a. 2×2 array of ones (integers)
    b. 2×2 array of zeros
    c. 1D array of ones
    d. 2×2 array of floats
    Answer: a. 2×2 array of ones (integers)letsfindcourse+1​
  1. https://letsfindcourse.com/data-science/python-numpy-mcq-questions
  2. https://www.projectpro.io/article/numpy-interview-questions-and-answers/980
  3. https://www.interviewbit.com/numpy-interview-questions/
  4. https://www.sanfoundry.com/data-science-questions-answers-campus-interviews/
  5. https://www.finalroundai.com/blog/numpy-interview-questions
  6. https://www.freshersnow.com/numpy-mcqs-and-answers-with-explanation/
  7. https://www.w3schools.com/python/numpy/numpy_quiz.asp
  8. https://rfaqs.com/python-quizzes/python-numpy-mcqs-11/
  9. https://upesonline.ac.in/blog/frequently-asked-numpy-interview-questions
  10. https://www.includehelp.com/python/numpy-mcqs.aspx
  11. https://www.geeksforgeeks.org/numpy/numpy-interview-questions/
  12. https://www.datacamp.com/blog/numpy-interview-questions
  13. https://www.devopsschool.com/blog/top-50-interview-questions-and-answers-of-numpy/
  14. https://www.gyansetu.in/blog/data-analytics-mcq-quiz-for-interview/
  15. https://www.geeksforgeeks.org/quizzes/python-numpy-quiz/
  16. https://www.sanfoundry.com/1000-data-science-questions-answers/
  17. https://www.scribd.com/document/724165142/Numpy-Multiple-Choice-Questions-And-Answers-NF-AI
  18. https://github.com/Devinterview-io/numpy-interview-questions

Leave a Reply

Your email address will not be published. Required fields are marked *

error: Content is protected !!