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
MrRa [10]
3 years ago
10

For this problem, you will write a function standard_deviation that takes a list whose elements are numbers (they may be floats

or ints), and returns their standard deviation, a single number. You may call the variance method defined above (which makes this problem easy), and you may use sqrt from the math library, which we have already imported for you. Passing an empty list to standard_deviation should result in a ZeroDivisionError exception being raised, although you should not have to explicitly raise it yourself.
Computers and Technology
1 answer:
Evgesh-ka [11]3 years ago
3 0

Answer:

  1. import math  
  2. def standard_deviation(aList):
  3.    sum = 0
  4.    for x in aList:
  5.        sum += x  
  6.    
  7.    mean = sum / float(len(aList))
  8.    sumDe = 0
  9.    for x in aList:
  10.        sumDe += (x - mean) * (x - mean)
  11.    
  12.    variance = sumDe / float(len(aList))
  13.    SD = math.sqrt(variance)
  14.    return SD  
  15. print(standard_deviation([3,6, 7, 9, 12, 17]))

Explanation:

The solution code is written in Python 3.

Firstly, we need to import math module (Line 1).

Next, create a function standard_deviation that takes one input parameter, which is a list (Line 3). In the function, calculate the mean for the value in the input list (Line 4-8). Next, use the mean to calculate the variance (Line 10-15). Next, use sqrt method from math module to get the square root of variance and this will result in standard deviation (Line 16). At last, return the standard deviation (Line 18).

We can test the function using a sample list (Line 20) and we shall get 4.509249752822894

If we pass an empty list, a ZeroDivisionError exception will be raised.

You might be interested in
When do we use an if- statement ​
wel

Answer:

You'd use an if statement if something happens. What I mean is that {If this happens} Then that happens but if the if doesnt happen then the then doesnt happen

Explanation:

3 0
3 years ago
Read 2 more answers
To mitigate the effects of most of the common network threats including disruption, destruction and disaster, companies are begi
almond37 [142]

Question:

To mitigate the effects of most of the common network threats including disruption, destruction and disaster, companies are beginning to migrate their servers, networking devices and data into professional datacenters. This is called

A) Colocation

B) SAAS

C) Peering

D) Clustering

E) Server Farming

Answer:

The correct answer is A) Colocation

Explanation:

Colocation as already defined is the voluntary relocation of all network facilities to a data centre so as to reduce the risks of disaster, disruption, destruction, intrusion whilst increasing security, flexibility and scalability at a lower cost.

As the world gets more digitized, datacentres are getting more patronage. The sales figures show this.

Cheers!

6 0
2 years ago
4. Give name=
Svet_ta [14]

Answer:

What does Bob [1] return?

What about Bob[-2]?

What about Bob[1:-1]?

How to get the length of Bob?​

Explanation:

8 0
3 years ago
A _______ is used to analyze and summarize your data without graphical support. A. PivotChart B. PivotTable C. chart D. table
Norma-Jean [14]
B. pivot table................................................
3 0
3 years ago
Cuales son los tipos de galeria virtual
Lelu [443]
¿Está usted preguntando cómo la galería virtual es importante, o el impacto que tiene.
5 0
3 years ago
Other questions:
  • A set of communication rules for the computer to follow is called, what?
    10·2 answers
  • Which of the following is NOT a Boolean Search term used to refine search engine results? A. AND B. With C. OR D. NOT
    14·2 answers
  • In the game of economics, producers look to technological improvements to increase which of the following?
    7·2 answers
  • Which of the following is NOT necessary for organizing data to make it easier to sort?
    6·1 answer
  • Which is said to be ‘computer on a chip’ (a) Micro processors (b) Microcontrollers (c) Both (c) None of the above
    9·1 answer
  • What is it called when you remove some information from a file or remove a file from the disk ? A) save b) delete c) edit d) rem
    5·1 answer
  • A reputable, world-renowned auction house uses blockchain to verify the authenticity of paintings prior to placing them up for s
    7·1 answer
  • When creating a study schedule, why is it important to be realistic about how much time everything requires?
    8·2 answers
  • All Office programs have similar commands on the tab for changing the document view a. File b. View c. Locate d. display ​
    5·1 answer
  • Why do you need to put your phone on airplane mode.
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!