Get startedGet started for free

Plotting the temperature difference

In this exercise, you'll continue to assess whether the dataset seems trustworthy by plotting the difference between the maximum and minimum temperatures.

What do you notice about the resulting histogram? Does it match your expectations, or do you see anything unusual?

This exercise is part of the course

Analyzing Police Activity with pandas

View Course

Exercise instructions

  • Create a new column in the weather DataFrame named TDIFF that represents the difference between the maximum and minimum temperatures.
  • Print the summary statistics for TDIFF using the .describe() method.
  • Create a histogram with 20 bins to visualize TDIFF.
  • Display the plot.

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

# Create a 'TDIFF' column that represents temperature difference


# Describe the 'TDIFF' column
print(____)

# Create a histogram with 20 bins to visualize 'TDIFF'


# Display the plot
Edit and Run Code