CommencerCommencer gratuitement

Compute numerical summaries

You have learnt how to display and annotate time series data in multiple ways, but it is also informative to collect summary statistics of your data. Being able to achieve this task will allow you to share and discuss statistical properties of your data that can further support the plots you generate. In pandas, it is possible to quickly obtain summaries of columns in your DataFrame by using the command:

print(df.describe())

This will print statistics including the mean, the standard deviation, the minima and maxima and the number of observations for all numeric columns in your pandas DataFrame.

Cet exercice fait partie du cours

Visualizing Time Series Data in Python

Afficher le cours

Instructions

  • Print the statistical summaries of the co2_levels DataFrame.
  • Print the reported minimum value in the co2_levels DataFrame.
  • Print the reported maximum value in the co2_levels DataFrame.

Exercice interactif pratique

Essayez cet exercice en complétant cet exemple de code.

# Print out summary statistics of the co2_levels DataFrame
print(____.____)

# Print out the minima of the co2 column in the co2_levels DataFrame
print(____)

# Print out the maxima of the co2 column in the co2_levels DataFrame
print(____)
Modifier et exécuter le code