Which of the following functions is used to find the unique elements of an array?
Correct answer
C. np.unique()
14 views
C. np.unique()
14 views
np.unique() returns the sorted unique elements of an array. With return_counts=True it also reports how many times each value occurs.
There is no distinct() in NumPy — that name comes from SQL.
Practise more Data Science MCQs with answers and explanations on MCQsExam.com.
Not sure why the answer is C? Ask here and get an explanation.