Loading...
Find unique elements and their counts in a NumPy array.
Write a function unique_count(arr) that returns a dictionary with:
Return a dictionary with exactly these three keys.
[1, 2, 2, 3, 3, 3, 4, 4, 4, 4]
{'unique': [1, 2, 3, 4], 'counts': [1, 2, 3, 4], 'num_unique': 4}1 appears once, 2 twice, 3 three times, 4 four times