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
NemiM [27]
4 years ago
10

Write a python code that creates a numpy array of 10 randomly generated values between 0 and 100.

Computers and Technology
1 answer:
Harlamova29_29 [7]4 years ago
8 0

Answer:

import random  #random to generate random integers.

import numpy as np #numpy to create a numpy array.

lis=[]#empty list.

random.seed()#seed to generate every time differnt random integers.

for i in range(10):#looping 10 times.

   a=random.randint(0,101)#generating random numbers.

   lis.append(a)#inserting into the lis list.

np_lis=np.array(lis)#converting lis to numpy array.

print(np_lis)#print the numpy array.

Explanation:

The above-written code generates a numpy array of 10 randomly generated integers.I have first created an emmpty list lis.To generate random numbers we have import random library.random.seed is used so that every time distinct random number are generated.The for loop is run 10 times.In for loop random number generated is stored in the variable a then it is added to the list lis.Then after the loop finishes the lis list is converted to numpy array np_lis.

You might be interested in
What is the letter for the trash directory on windows 10?
myrzilka [38]
It's usually in C: drive.
<span>C:\$Recycle.Bin
</span>But if you have several drives, there are Recycle Bins each drive.
3 0
3 years ago
Read 2 more answers
18. Applying what formatting option to your Excel workbook will make it easier to read when printed out?
Sergeu [11.5K]
Depending on the data all answers can be used to make it easier to read. Without more info I would go with Borders (D) since they are the best way to group the data when printed, especially if the print is in color.

Alignment would be the correct answer only if the data goes out of cell boundaries. Font Color usually makes it harder to read because of bad contrast and finally changing the Font Style has a minimal effect since the default one is already pretty readable.
7 0
3 years ago
What is the term for an e-mail server program that receives sent messages and delivers them to their proper destination?
Katarina [22]
MTA (Mail Transfer Agent)
6 0
3 years ago
Java and Python are considered rapid development programming languages?<br><br> True<br><br> False
Zepler [3.9K]
That is true because Java was considered a rapid development programming language
8 0
4 years ago
Read 2 more answers
Why does my messenger say this person is unavailable on messenger.
max2010maxim [7]

Answer:

The person left

Explanation:

The person could of been banned or deleted their account

3 0
3 years ago
Other questions:
  • How is the JOptionPaneclass used to display a dialog box that performs a yes/noconfirmation?
    10·1 answer
  • The trigonometry book says: sin^2(t) + cos^2(t) = 1 Write a Python program that verifies the formula with the help of the Python
    11·1 answer
  • PLEASE HELP!!! THIS IS WORTH A TEST GRADE!!!
    13·1 answer
  • If E=mc2 then what does F equal?
    10·1 answer
  • PLZZZ HELP!!! I’ll give brainliest
    12·1 answer
  • The signature area in a cover letter includes the sender's first and last name, followed by his/her job title (if applicable). *
    13·1 answer
  • He flow of electric charges through a material describes an electric _______.
    10·1 answer
  • Given a constant named size with a value of 5, which statement can you use to define and initialize an array of doubles named ga
    12·1 answer
  • If, after fetching a value from memory, we discover that the system has returned only half of the bits that we expected; it is l
    8·1 answer
  • When Brittany practiced her presentation, she gave a trusted adult a presentation checklist to use to critique her each time she
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!