Visualizing relationships over time
Now that your date data is saved as DateTime data, you can explore patterns over time! Does the year that a couple got married have a relationship with the number of children that the couple has at the time of divorce? Your task is to find out!
The divorce
DataFrame (with all dates formatted as DateTime data types) has been loaded for you. pandas
has been loaded as pd
, matplotlib.pyplot
has been loaded as plt
, and Seaborn has been loaded as sns
.
This exercise is part of the course
Exploratory Data Analysis in Python
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# Define the marriage_year column
divorce["marriage_year"] = ____