Given the code below, what is printed by the final line of code (i.e., by np.argsort(y)) and why? y = np.array([0, 100, -100, -1]) print(np.argsort(y))

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter9: Advanced Array Concepts
Section: Chapter Questions
Problem 9RQ
icon
Related questions
Question

1. Given the code below, what is printed by the final line of code (i.e., by np.argsort(y)) and why?

y = np.array([0, 100, -100, -1])
print(np.argsort(y))
 
2. Write a few lines of code plotting the numpy array "image", which is a two-dimensional array (assume that it has already been defined/define it for yourself!). Make the figure size of your plot equal to (7, 5) and set the 'cmap' argument to be "plasma" (check it out, it's super cool!). Also include the colorbar for the plot.
 
 
 
 
 
 
Expert Solution
steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Arrays
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT