Skip to content

lab functions Marc Planas - #6

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

lab functions Marc Planas#6
mplanasgit wants to merge 2 commits into
Ironhack-data-bcn-oct-2022:mainfrom
mplanasgit:main

Conversation

@mplanasgit

@mplanasgit mplanasgit commented Oct 6, 2022

Copy link
Copy Markdown

1 exercises pending, it's difficult! #TA help
Marc

@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 check the following code and see what you would have to change.
Besides that great work! keep it up!

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