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
You are setting up your Windows computer to connect to the Internet and notice that when you type www.microsoft, the browser doe
Harrizon [31]

Answer:

Check your DNS settings

Explanation:

Different errors may occur when setting up your computer to connect to the internet, one of which is described in the question above.

The DNS (Domain Name System) is responsible for redirecting domain names to their physical IP address. Instead of remembering every IP address of sites you visit frequently, domain names are used for easy remembrance, the DNS makes the matching of domain names to IP addresses possible.

To change your DNS setting follow these steps:

  1. Click settings from your start menu
  2. Click on Network and Internet
  3. Look to the bottom of the main page and click on "Network and Sharing Center"
  4. On the left tab, click "Change adapter settings"
  5. Right Click on the current network you are using and select properties
  6. Left-click on the "Internet Protocol Version 4 (TCP/IPv4) and click on properties.
  7. Check to see if "Obtain DNS server address automatically" is selected, if it is selected,
  8. Click on the radio button under it "Use the following DNS server address"
  9. Enter the DNS address you want to use
  10. Click Ok and close the window.

The problem should be resolved.

4 0
3 years ago
One of the newest electronic conveniences is the ________, which can serve as a credit card, a debit card, and even unlock doors
77julia77 [94]
Computer Chips. / SILICON. This is just an educated guess
7 0
3 years ago
True or false: you should reuse passwords on multiple websites because it will help you remember those passwords
Fudgin [204]

Answer: False

Explanation: Even though you can remember it is not really good because some hackers can track you passwords through those websites and could hack your account.

3 0
2 years ago
Read 2 more answers
What are impacts of ict in every day your life?describe if prifely​
telo118 [61]

Answer:

ICT is a broad subject and a concept of evolving.It covers any product that will store, retrieve, manipulate, transmit, or receive information electronically in a digital form.

Explanation:

HOW WE USE ICT IN OUR DAILY LIFE

COMMUNICATION

JOB OPPORTUNITIES

EDUCATION

SOCIALIZING

POSITIVE IMPACT OF ICT IN OUR DAILY LIFE

1.Easy to access information:

I use ICT to access more information that I need for everyday schooling.Because Internet has more faster than searching to a school library. Even the deadline of my research is coming, I can make it fast with the help of ICT

2. Education: distance learning and on-line tutorials. New ways of learning, e.g. interactive multi-media and virtual reality.

3.Free access of sharing like photo,video,and message

5 0
2 years ago
What does "CYBER-COCKROACH" mean??
katrin2010 [14]

Answer:

The cyber cockroach is the presented external anatomy of a cockroach, with labeled views of photographs from diverse angles in place of diagrams. The cyber cockroach can be navigated around the head, thorax and abdomen with possible close up views of the legs and the images are downloadable

Cyber cockroach is a useful tool for the study of insects of the Blattodea order

Explanation:

3 0
3 years ago
Other questions:
  • Select all that apply. Hyperlinks can appear as: words pictures symbols trademarks
    12·2 answers
  • Technician A says that the last step in the diagnostic process is to verify the problem. Technician B says that the second step
    12·1 answer
  • Write a program that inputs a time from the console. The time should be in the format "HH:MM AM" or "HH:MM PM". Hours may be one
    6·1 answer
  • A computer has a pipeline with four stages. Each stage takes the same time to do its
    8·1 answer
  • Your organization recently deployed a Windows domain controller with Active Directory. All the domain OU users need to run the s
    11·1 answer
  • NEED HELP RIGHT NOW!!! Which of the following is the definition of a privacy policy? * 5 points - A legal document that an app o
    6·1 answer
  • For a typical middle-income family, what is the estimated cost of raising a child to the age of 18?
    11·1 answer
  • The file descriptor stderr is represented by the number ____.
    6·1 answer
  • Hey should I get a r()blox gift card if so what amount 5 dollars 10 or 100
    14·1 answer
  • Mattias's friend asked him to critique his presentation about gorillas. Mattias noticed that there weren't any images of gorilla
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!