LinkedIn Python Skill Assessment Quiz Answers

What is the output of this code? (NumPy has been imported as np.)?

Latest Update on 25th January, 2022 by Certification Course Answers

What is the output of this code? (NumPy has been imported as np.)?

Options 1:

a = np.array([1,2,3,4])
print(a[[False, True, False, False]])
  1.  {0,2}
  2.  [2]
  3.  {2}
  4.  [0,2,0,0]

Correct Answer:

  •  [2]

Options 2:

table = np.array([
    [1,3],
    [2,4]])
print(table.max(axis=1))
  1.  [2, 4]
  2.  [3, 4]
  3.  [4]
  4.  [1,2]

Correct Answer:

  •  [3, 4]

Latest Updates

No posts found in this category.