Question: Must be answered in one line using np.where for numpy arrays. Thank you! def where(scores): 4. Madison wants to create a simple visual based

Must be answered in one line using np.where for numpy arrays. Thank you!

def where(scores): """ 4. Madison wants to create a simple visual based on how happy she is after each game. Replace the days where she earns from [-infinity, 9) points with a ':(', the days where she earns [10, 19) points with ':)', and the days where she earns [20, infinity) points with ':D'. Return this array.

Args: scores (array): the array that represent's Madison's points per game over several weeks

Returns: nd.array with Madison's scores replaced by various amounts of dollar signs

>>> scores = np.array([[20, 15, 28, 3, 15], [24, 6, 32, 27, 22]]) >>> where(scores) array([[':D', ':)', ':D', ':(', ':)'], [':D', ':(', ':D', ':D', ':D']], dtype='

"""

pass

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!