Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Use Python 3 in Jupyter Write a function called countUnique that has one parameter which is a NumPy array. The array will be a list

Use Python 3 in Jupyter

Write a function called countUnique that has one parameter which is a NumPy array. The array will be a list of integers with many repeated values. The function should count how many times each unique integer appears and return the counts. For example, if it is given the array array([3, 3, 3, 1, 1, 3, 1, 1, 3, 2]), it should return the counts [(1, 4), (2, 1), (3, 5)] since 1 appears 4 times, 2 appears once, and 3 appears 5 times.

In a separate code cell, create an create a NumPy array of 20 random integers from 1 to 20. Use your countUnique to determine how many times each number appears.

In a separate code cell, create an create a NumPy array of 10,000 random integers from 1 to 5. Use your countUnique to determine how many times each number appears.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Marketing The New Profit Frontier

Authors: Ed Burnett

1st Edition

0964535629, 978-0964535626

More Books

Students also viewed these Databases questions

Question

600 lb 20 0.5 ft 30 30 5 ft

Answered: 1 week ago

Question

Demonstrate three aspects of assessing group performance?

Answered: 1 week ago