Skip to content

[Francesc Andreu] Day 4 LAB - #1

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

[Francesc Andreu] Day 4 LAB#1
francescandreu wants to merge 1 commit into
Ironhack-data-bcn-oct-2022:mainfrom
francescandreu:main

Conversation

@francescandreu

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!

Check the following code for question 9 and see how this works. make some changes in your code or try and understand what I have just send you!

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