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
3 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]3 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
Fill in the missing step in the following deadlock situation. Two users from the local board of education are each running a pro
Softa [21]

Answer:

b. P2 requests drive 2 and gets it.

Explanation:

Two users from the local board of education are each running a program (P1 and P2), and both programs will eventually need two DVD drives to copy files from one disc to another. Only two DVD-R drives are available and they’re allocated on an "as requested" basis. Soon the following sequence transpires: P2 requests drive 2 and gets it.

7 0
3 years ago
I need names for an anime and powers so plz make then unique
Olegator [25]
Make your own name for your anime and your own powers it’s really not that hard bud
5 0
3 years ago
The means by which an operating system or any other program interacts with the user is called th
natulia [17]
Networking capabilities of a computer
7 0
3 years ago
How do I write this code in java? input "Enter Your Age to Order a Beer"
Klio2033 [76]

Answer:

i dont know sorry but answer above lol

Explanation:

5 0
3 years ago
How can this be achieved? Universal Containers stores invoices in SAP. Users want to view invoice data onthe related Account rec
Nookie1986 [14]

Answer:

Option B  and  Option D

are correct answers.

Explanation:

To view the invoice data on the related account records in sales force when invoices are stored in SAP we must:

  • Create an External Object connected to an invoice table in SAP

           OR

  • Connect to an O-Data Publisher Service for SAP databases.

SAP can be defined as Systems, Applications and Products. SAP is basically a software which has a backbone of SAP ERP (most advance Enterprise Resource Planing). SAP software helps to manage many business areas by providing powerful tools that include financial and logistic areas.

<h2 /><h2>I hope it will help you!</h2>
6 0
3 years ago
Other questions:
  • You've been hired as a consultant to help an online store owner. You need to complete the implementation of conversion tracking
    5·1 answer
  • Which of the following is generally nota desire today's workers? A. computer ability B willingness to learn C. teamwork skills D
    8·1 answer
  • An electronic storage file where information is kept is called a cpu. true false
    11·1 answer
  • Which type of virus includes protective code that prevents outside examination of critical elements?
    14·1 answer
  • The Office ____ is a temporary storage area. Warehouse Clipboard Storehouse Gallery
    15·1 answer
  • Help with this please anyone
    15·2 answers
  • Need help asap please​
    13·1 answer
  • Implement the ArrayMethod application containing an array that stores eight integers. The application should call the following
    12·1 answer
  • 9. These particular machines can be decentralized.
    9·1 answer
  • When delivering digital technologies to clients, what is a best practice to make those solutions sustainable?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!