Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

python code to perform the following tasks: Take two numpy arrays (e.g. a = numpy.array([1,1,2,3,5,8,13,21,34,55,89]) and b = numpy.array([1,2,3,4,5,6,7,8,9,10,11,12,13]). Write a program that returns a

python code to perform the following tasks:

Take two numpy arrays (e.g. a = numpy.array([1,1,2,3,5,8,13,21,34,55,89]) and b = numpy.array([1,2,3,4,5,6,7,8,9,10,11,12,13]). Write a program that returns a numpy array that contains only the elements that are common between the lists (without duplicates). Make sure your program works on two lists of different sizes and test the program by randomly generating two integer lists of size 20 and 25, respectively containing numbers from 0 to 99. Test the performance of this function using the %timeit functionality in a notebook and write the observed time below (hint: numpy.unique() function removes duplicates in numpy arrays. also consider using a boolean mask)

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

Beginning Databases With PostgreSQL From Novice To Professional

Authors: Richard Stones, Neil Matthew

2nd Edition

1590594789, 978-1590594780

More Books

Students also viewed these Databases questions

Question

What is the basis for Security Concerns in Cloud Computing?

Answered: 1 week ago

Question

Describe the three main Cloud Computing Environments.

Answered: 1 week ago