Skip to content

Cason function lab - #15

Open
casoncalvet wants to merge 1 commit into
Ironhack-data-bcn-oct-2022:mainfrom
casoncalvet:main
Open

Cason function lab#15
casoncalvet wants to merge 1 commit into
Ironhack-data-bcn-oct-2022:mainfrom
casoncalvet:main

Conversation

@casoncalvet

Copy link
Copy Markdown

No description provided.

@samuelTAIronhack samuelTAIronhack left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for question 9 have a look at the following solution

`
from statistics import stdev
def st_dev(arr):

total_elements = 0
total_sum_elements = 0

for num in arr:
    total_elements +=1
    total_sum_elements += num

mean = total_sum_elements/total_elements

deviation = 0

for num in arr:
    deviation += (num-mean)**2

standard_deviation = (deviation/(total_elements-1))**0.5

return standard_deviation`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants