1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
german
4 years ago
9

Write a code that makes a 2D square array with 20×20 elements. Fill the array with random numbers initially. Then, "draw" a squa

re in the array by adding a value of 4 to those array elements, and plot it with imshow. The square should be centered and have side lengths of 10 .
Computers and Technology
1 answer:
NemiM [27]4 years ago
4 0

Answer:

Answer explained below. Python language used

Explanation:

The size of the square is of size 10. So assuming zero indexing,

vertical side1 (column Index = 5): row index from 5 to 14

vertical side1 (column Index = 14): row index from 5 to 14

horizontal side1 (row Index = 5): column index from 5 to 14

horizontal side2 (row Index = 14): column index from 5 to 14

Note:

while indexing, data_new[a:b,c] denotes,

row index: a to b-1

column index: c

Similarly data_new[a,b:c] denotes,

row index: a

column index: b to c-1

<u>Code: </u>

import matplotlib.pyplot as plt

import numpy as np

size_1 = 20

size_2 = 20

data_new = np.random.random((size_1,size_2))

data_new[5:15,5] = 4

data_new[5:15,14] = 4

data_new[5,5:15] = 4

data_new[14,5:15] = 4

fig = plt.figure(figsize=(10,10))

plt.imshow(data_new)

plt.colorbar()

plt.show()

You might be interested in
An independent penetration testing company is invited to test a company's legacy banking application developed for Android phone
erastovalidia [21]

2010s is the one who created the iPhone

8 0
3 years ago
What should be the very last function performed in the lab before you leave? Bid the instructor farewell wipe your hands on a to
34kurt

Answer:

Wash your hands with soap and water.

Explanation:

This answer comes with common sense, because before you leave, you MUST wash your hands, it's hygiene measure.

7 0
3 years ago
________ is a suite of protocols designed to connect sites securely using ip networks.
a_sh-v [17]
IPSec


Hope that helps, Good luck!! (:
7 0
4 years ago
Read 2 more answers
Write and test a Python program to find and print the largest number in a set of real (floating point) numbers. The program shou
fenix001 [56]

I can't read oooooyeaaaa

3 0
4 years ago
Paul is playing a game when his computer shuts down unexpectedly. Paul has noticed recently that his fans are running very loud.
Elis [28]

Answer:

there is a lot of heat in his computer he should let the computer rest for some time and then use it again

5 0
4 years ago
Other questions:
  • As of 2012, Twitter has approximately how many members?
    10·1 answer
  • ______was developed as an interim management protocol with OSI as the ultimate network management protocol.
    5·1 answer
  • Predictive coding software leverages .............................when experts review a subset of documents to teach the softwar
    15·1 answer
  • TolTel Inc., an information technology firm, has created a network that allows its employees to easily access, share, and publis
    11·1 answer
  • So lets see what you know...Write me a short code and include a detailed explanation of the language used and what the out come
    7·1 answer
  • Where can you go in QuickBooks Online to import a list of products and services? Select the Quick Create icon and under the Tool
    12·1 answer
  • The two main methods of verification
    6·1 answer
  • Adobe Indesign project 4 museum indesign file. The instructions are 70 pages long I cant sit still long enough to read them
    11·1 answer
  • What is the function of a text box in Microsoft word?​
    13·1 answer
  • A user can add color to a database to highlight a modification. To do this with a macro, which command screen would you access o
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!