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
_____ allows you to use the internet for making phone calls instead of leasing traditional telephone lines from the phone compan
TEA [102]
Using a browser would help in doing that.
3 0
2 years ago
If Tamya makes $1000.00 gross monthly income and her total payroll deductions are $294.00, what is her net income?
Maru [420]

Answer:

$751

Explanation:

From the question we have the following information;

Gross income = $1000.00

Deductions =   $294.00

Now we know that;

Net income = Gross income - Deductions

Therefore;

Net income = $1000.00 -  $294.00

Net income = $751

7 0
2 years ago
Selective colleges choose to have in-person meetings to learn more about the applicants. These meetings are called:
lubasha [3.4K]
The meeting is called collage interviews
4 0
3 years ago
Read 2 more answers
Which of these benefits can be achieved whensoftware is restructured?
Ivenika [448]

Answer:

iv. all of the given options

Explanation:

This is the correct answer because this is what happens when software is restructured.

<em>PLEASE</em><em> </em><em>DO MARK</em><em> </em><em>ME AS</em><em> </em><em>BRAINLIEST</em><em> </em><em>IF</em><em> </em><em>MY ANSWER</em><em> </em><em>IS HELPFUL</em><em> </em><em>;</em><em>)</em><em> </em>

4 0
3 years ago
16. If a user can make modifications to database objects, what permission has that
Vsevolod [243]

B

Explanation:

The Alter command is used when we want to modify a database or object contain in database.

5 0
2 years ago
Other questions:
  • What is the name for software designed to find and open Web documents?
    8·1 answer
  • What does snap do need the answer now
    10·2 answers
  • Which of the following is an object-oriented prototype-based language? Java Pike REBOL MATLAB
    9·1 answer
  • Do you think the current system of punishment in the United States works? Why? What would you change?
    13·1 answer
  • . Select the advantages of RAID-5 relative to other RAID schemes. (MAY SELECT MULTIPLE)
    7·1 answer
  • Project manager Erica is discussing with her team to prepare a document to describe the deliverables and goals of a software pro
    13·1 answer
  • Which shape is used for input or output?
    15·1 answer
  • The merge and center
    14·1 answer
  • Software that converts program written in other language into machine language​
    11·1 answer
  • Ninety percent of the fastest-growing jobs require some kind of postsecondary education.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!