Aan de slagGa gratis aan de slag

The standard deviation and the variance

As mentioned in the video, the standard deviation is the square root of the variance. You will see this for yourself by computing the standard deviation using np.std() and comparing it to what you get by computing the variance with np.var() and then computing the square root.

Deze oefening maakt deel uit van de cursus

Statistical Thinking in Python (Part 1)

Cursus bekijken

Oefeninstructies

  • Compute the variance of the data in the versicolor_petal_length array using np.var() and store it in a variable called variance.
  • Print the square root of this value.
  • Print the standard deviation of the data in the versicolor_petal_length array using np.std().

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

# Compute the variance: variance


# Print the square root of the variance


# Print the standard deviation
Code bewerken en uitvoeren