Skip to content

Marc Dalmau Marcé - #10

Open
marcdalmaum wants to merge 2 commits into
Ironhack-data-bcn-oct-2022:mainfrom
marcdalmaum:main
Open

Marc Dalmau Marcé#10
marcdalmaum wants to merge 2 commits into
Ironhack-data-bcn-oct-2022:mainfrom
marcdalmaum:main

Conversation

@marcdalmaum

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.

Good work!

for question 9 have a look at the following solution and see how you can change the code you have written!

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