Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I want you to return number of oscar winners that less than 35 years old. No for loops allowed. Ex: x-[[25 1998] [43 1999]] then,

image text in transcribed

I want you to return number of oscar winners that less than 35 years old. No for loops allowed. Ex: x-[[25 1998] [43 1999]] then, your method should return 1 as the only age less than 35 is 25. Note that you code should NOT count the years. In : def psn(x): return count of all ages less than 35, for a 2D matrix. # YOUR CODE HERE raise NotImplementedError) In [ ]: #test area p-np.array([[1998, 25].[1999, 43]]) # p-np.arange ( 28,38).re shape ( 5,2) print(p) print(psn(p)) In :"Check that method returns the correct output for several inputs" #assert p-np.array ([[1998, 25],[1999, 43]]) q-1; np.testing.assert_allclose( psn(p), q) p np.arange(28,3a).reshape(t5,2) q-3 np.testing.assert_allclose(psn(p), q)

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

Fundamentals Of Database Management Systems

Authors: Mark L. Gillenson

3rd Edition

978-1119907466

More Books

Students also viewed these Databases questions

Question

What shorter and longer-term career goals spark your interest?

Answered: 1 week ago