Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Leer Variantie en Standaarddeviatie Berekenen | Variantie en Standaarddeviatie
Statistiek Leren Met Python

book
Variantie en Standaarddeviatie Berekenen

Taak

Swipe to start coding

Bereken de variantie en de standaarddeviatie van de kolom 'salary' met behulp van de pandas-bibliotheek.

Oplossing

# Import library
import pandas as pd

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 variance
var = df['salary'].var()
# Calculate the standard deviation
std = df['salary'].std()

print('The variace is', round(var, 2))
print('The standard deviation is', round(std, 2))
Was alles duidelijk?

Hoe kunnen we het verbeteren?

Bedankt voor je feedback!

Sectie 3. Hoofdstuk 6
single

single

# Import library
___

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 variance
var = ___
# Calculate the standard deviation
std = ___

print('The variace is', round(var, 2))
print('The standard deviation is', round(std, 2))

Vraag AI

expand

Vraag AI

ChatGPT

Vraag wat u wilt of probeer een van de voorgestelde vragen om onze chat te starten.

some-alt