Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lære Standardavvik med Python | Varians og Standardavvik
Lære Statistikk med Python
course content

Kursinnhold

Lære Statistikk med Python

Lære Statistikk med Python

1. Grunnleggende Konsepter
2. Gjennomsnitt, Median og Modus med Python
3. Varians og Standardavvik
4. Kovarians vs. Korrelasjon
5. Konfidensintervall
6. Statistisk Testing

book
Standardavvik med Python

Den første funksjonen er fra numpy, og den andre metoden er fra pandas. Se på eksemplet for beregning av standardavviket for work_year:

123456789101112
import pandas as pd import numpy as np df = pd.read_csv('https://codefinity-content-media.s3.eu-west-1.amazonaws.com/a849660e-ddfa-4033-80a6-94a1b7772e23/update/ds_salaries_statistics', index_col = 0) # Calculate the standard deviation using the function from the NumPy library std_1 = np.std(df['salary_in_usd']) # Calculate the standard deviation using the function from the pandas library std_2 = df['salary_in_usd'].std() print('The standard deviation using NumPy library is', round(std_1, 2)) print('The standard deviation using pandas library is', round(std_2, 2))
copy
Alt var klart?

Hvordan kan vi forbedre det?

Takk for tilbakemeldingene dine!

Seksjon 3. Kapittel 5

Spør AI

expand
ChatGPT

Spør om hva du vil, eller prøv ett av de foreslåtte spørsmålene for å starte chatten vår

course content

Kursinnhold

Lære Statistikk med Python

Lære Statistikk med Python

1. Grunnleggende Konsepter
2. Gjennomsnitt, Median og Modus med Python
3. Varians og Standardavvik
4. Kovarians vs. Korrelasjon
5. Konfidensintervall
6. Statistisk Testing

book
Standardavvik med Python

Den første funksjonen er fra numpy, og den andre metoden er fra pandas. Se på eksemplet for beregning av standardavviket for work_year:

123456789101112
import pandas as pd import numpy as np df = pd.read_csv('https://codefinity-content-media.s3.eu-west-1.amazonaws.com/a849660e-ddfa-4033-80a6-94a1b7772e23/update/ds_salaries_statistics', index_col = 0) # Calculate the standard deviation using the function from the NumPy library std_1 = np.std(df['salary_in_usd']) # Calculate the standard deviation using the function from the pandas library std_2 = df['salary_in_usd'].std() print('The standard deviation using NumPy library is', round(std_1, 2)) print('The standard deviation using pandas library is', round(std_2, 2))
copy
Alt var klart?

Hvordan kan vi forbedre det?

Takk for tilbakemeldingene dine!

Seksjon 3. Kapittel 5
Vi beklager at noe gikk galt. Hva skjedde?
some-alt