Notice: Due to an ongoing migration of our storage and publishing system, material requested since last month will not be uploaded for the time being, and new requests are paused. All existing notes remain available.

Unit 8 MCQs NumPy functions

ECAP776 60 questions. Pick an option to check it.

Read the notes Subjective questions

0 of 60 answered 0 right 0 wrong , 60 left

  1. Question 1 of 60 Mathematical functions Easy

    Which NumPy function calculates the square root of each element in an array?

  2. Question 2 of 60 Mathematical functions Easy

    What is the result of np.square(np.array([2, 3]))?

  3. Question 3 of 60 Mathematical functions Easy

    Which NumPy function returns the absolute value of every array element?

  4. Question 4 of 60 Mathematical functions Easy

    What does np.exp(x) calculate for each element ?

  5. Question 5 of 60 Statistical functions Easy

    Which NumPy function calculates the arithmetic mean of an array?

  6. Question 6 of 60 Statistical functions Easy

    What is the value of np.mean([2, 4, 6])?

  7. Question 7 of 60 Statistical functions Easy

    Which NumPy function finds the middle value of sorted numerical data?

  8. Question 8 of 60 Statistical functions Easy

    Which NumPy function calculates the standard deviation of array values?

  9. Question 9 of 60 Sort functions Easy

    Which function returns a sorted copy of a NumPy array?

  10. Question 10 of 60 Sort functions Easy

    What is the result of np.sort([3, 1, 2])?

  11. Question 11 of 60 Sort functions Easy

    What does np.argsort() return?

  12. Question 12 of 60 Sort functions Easy

    By default, in which order does np.sort() arrange numeric values?

  13. Question 13 of 60 Search functions Easy

    Which NumPy function returns indices where a condition is true?

  14. Question 14 of 60 Search functions Easy

    For a = np.array([4, 7, 2]), what does np.argmax(a) return?

  15. Question 15 of 60 Search functions Easy

    Which function returns the index of the smallest array element?

  16. Question 16 of 60 Search functions Easy

    What is np.searchsorted() mainly used for?

  17. Question 17 of 60 Counting functions Easy

    Which NumPy function counts the nonzero elements in an array?

  18. Question 18 of 60 Counting functions Easy

    What is the result of np.count_nonzero([0, 5, 0, 3])?

  19. Question 19 of 60 Counting functions Easy

    Which call returns unique values and how many times each value appears?

  20. Question 20 of 60 Counting functions Easy

    What does np.count_nonzero(a > 5) count?

  21. Question 21 of 60 Mathematical functions Medium

    What is the result of np.sqrt(np.abs(np.array([-1, 4, 9])))?

  22. Question 22 of 60 Mathematical functions Medium

    Given a = np.array([[1], [2]]) and b = np.array([10, 20, 30]), what does np.add(a, b) return?

  23. Question 23 of 60 Mathematical functions Medium

    What is returned by np.floor(np.array([-1.2, 2.8]))?

  24. Question 24 of 60 Mathematical functions Medium

    Given x = np.array([2, 7, 4]) and y = np.array([3, 5, 4]), what is the result of np.maximum(x, y)?

  25. Question 25 of 60 Statistical functions Medium

    For a = np.array([[2, 4, 6], [8, 10, 12]]), what does np.mean(a, axis=0) return?

  26. Question 26 of 60 Statistical functions Medium

    What is the value of np.median(np.array([1, 7, 3, 9]))?

  27. Question 27 of 60 Statistical functions Medium

    Approximately what does np.std(np.array([2, 4, 6])) return when no ddof argument is specified?

  28. Question 28 of 60 Statistical functions Medium

    What is the result of np.percentile(np.array([0, 10, 20, 30, 40]), 25) using NumPy's standard linear calculation?

  29. Question 29 of 60 Sort functions Medium

    Given a = np.array([[3, 1], [4, 2]]), what does np.sort(a, axis=1) return?

  30. Question 30 of 60 Sort functions Medium

    What does np.argsort(np.array([30, 10, 20])) return?

  31. Question 31 of 60 Sort functions Medium

    For a = np.array([9, 1, 7, 3]), what value is guaranteed at a[np.argpartition(a, 2)[2]]?

  32. Question 32 of 60 Sort functions Medium

    What is the shape and content of np.sort(np.array([[4, 1], [3, 2]]), axis=None)?

  33. Question 33 of 60 Sort functions Medium

    Given secondary = np.array([2, 1, 1]) and primary = np.array([1, 1, 0]), what does np.lexsort((secondary, primary)) return?

  34. Question 34 of 60 Search functions Medium

    What does np.where(np.array([2, 7, 4, 9]) > 4) return?

  35. Question 35 of 60 Search functions Medium

    For a = np.array([[1, 9, 3], [8, 2, 7]]), what does np.argmax(a, axis=1) return?

  36. Question 36 of 60 Search functions Medium

    What is returned by np.searchsorted(np.array([10, 20, 30, 40]), 25)?

  37. Question 37 of 60 Search functions Medium

    What does np.flatnonzero(np.array([[0, 5], [2, 0]])) return?

  38. Question 38 of 60 Counting functions Medium

    For a = np.array([[0, 1, 2], [3, 0, 2]]), what does np.count_nonzero(a, axis=0) return?

  39. Question 39 of 60 Counting functions Medium

    Given a = np.array([2, 1, 2, 3, 1, 2]), which pair is returned by np.unique(a, return_counts=True)?

  40. Question 40 of 60 Counting functions Medium

    What does np.bincount(np.array([0, 2, 2, 1]), minlength=4) return?

  41. Question 41 of 60 Mathematical functions Hard

    Given a = np.array([np.nan, -2.0, 3.0]) and b = np.array([2.0, -1.0, np.nan]), what does np.fmax(a, b) return?

  42. Question 42 of 60 Mathematical functions Hard

    What are fractional and integral after fractional, integral = np.modf(np.array([-2.75, 3.5]))?

  43. Question 43 of 60 Mathematical functions Hard

    Consider x = np.array([1., 4., 9., 16.]), out = np.full(4, -1.), and np.sqrt(x, out=out, where=np.array([True, False, True, False])). What is out afterward?

  44. Question 44 of 60 Mathematical functions Hard

    Ignoring normal floating-point rounding, what is np.logaddexp(1000.0, 1000.0) designed to compute without overflowing?

  45. Question 45 of 60 Statistical functions Hard

    Given x = np.array([[1., 2., 9.], [4., 8., 12.]]), what is x - np.mean(x, axis=1, keepdims=True)?

  46. Question 46 of 60 Statistical functions Hard

    For x = np.array([1., 2., 3.]), what is np.var(x, ddof=1) - np.var(x, ddof=0)?

  47. Question 47 of 60 Statistical functions Hard

    What does np.average(np.array([[1., 3.], [5., 7.]]), axis=1, weights=np.array([1., 3.]), returned=True) return?

  48. Question 48 of 60 Statistical functions Hard

    Given x = np.array([[np.nan, np.nan], [1.0, np.nan]]), what is np.nanmean(x, axis=1)?

  49. Question 49 of 60 Sort functions Hard

    Let a = np.array([2, 1, 2, 1]) and b = np.array([1, 2, 0, 1]). What is np.lexsort((a, b))?

  50. Question 50 of 60 Sort functions Hard

    After y = np.partition(np.array([9, 1, 8, 2, 7]), 2), which property is guaranteed?

  51. Question 51 of 60 Sort functions Hard

    What is np.argsort(np.array([3, 1, 3, 1]), kind="stable")?

  52. Question 52 of 60 Sort functions Hard

    Given a = np.array([[3, 1], [2, 4], [3, 0]]), what is np.sort(a, axis=0)[::-1]?

  53. Question 53 of 60 Search functions Hard

    For a = np.array([1, 2, 2, 2, 5]), what is np.searchsorted(a, [2, 3], side="right")?

  54. Question 54 of 60 Search functions Hard

    Let a = np.array([30, 10, 20]) and sorter = np.argsort(a). What does np.searchsorted(a, 25, sorter=sorter) return?

  55. Question 55 of 60 Search functions Hard

    Given a = np.array([[5, 9], [9, 1]]), what is np.unravel_index(np.argmax(a), a.shape)?

  56. Question 56 of 60 Search functions Hard

    For a = np.array([[0.0, np.nan], [-2.0, 0.0]]), what does np.where(a) return?

  57. Question 57 of 60 Counting functions Hard

    What is np.count_nonzero(np.array([0.0, np.nan, -0.0, np.inf]))?

  58. Question 58 of 60 Counting functions Hard

    Given a = np.array([[[1, 0], [0, 2]], [[0, 3], [4, 0]]]), what is np.count_nonzero(a, axis=(0, 2), keepdims=True)?

  59. Question 59 of 60 Counting functions Hard

    What is np.bincount([2, 0, 2, 1], weights=[0.5, 1.5, 2.0, 1.0], minlength=4)?

  60. Question 60 of 60 Counting functions Hard

    Given a = np.array([[1, 2], [1, 2], [2, 1], [1, 2]]), what does np.unique(a, axis=0, return_counts=True) return?

That's unit 8

Answer a few questions and your score shows up here.