Welcome to your personalized data journey! This notebook is designed to help you analyze your DataCamp progress over the past year, so you can set a goal, build a habit, and take actionable next steps for 2025. Dive into your learning data, including exercises completed, workbooks created, and more. Discover insights, track your habits, and set new goals for the upcoming year. Let's explore your year in data together!
🧭 Get familiar and explore your data by opening the context panel
🎯 Challenge 1: Set a Goal
Set your XP milestones: Using the xp_earned data, find your biggest XP-earning days. Use this insight to set specific XP milestones for 2025 that keep you motivated.
1️⃣ Below you will find an example, run this cell to see what is possible...
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
# Read in the data
xp_earned = pd.read_csv('data/xp_earned.csv', parse_dates=['earned_at'])
# Ensure the 'date' column is in datetime format
xp_earned['date'] = pd.to_datetime(xp_earned['earned_at'])
# Create columns for week number and day of the week
xp_earned['week'] = xp_earned['earned_at'].dt.isocalendar().week
xp_earned['day'] = xp_earned['earned_at'].dt.dayofweek
# Create a DataFrame to ensure all days and weeks are represented
all_weeks = range(1, 53) # Weeks 1 to 52
all_days = range(0, 7) # Days 0 (Monday) to 6 (Sunday)
full_index = pd.MultiIndex.from_product([all_days, all_weeks], names=['day', 'week'])
# Sum XP earned for each day and week, reindex to fill missing values with 0
heatmap_data = xp_earned.pivot_table(index='day', columns='week', values='xp_amount', aggfunc='sum', fill_value=0)
heatmap_data = heatmap_data.reindex(index=all_days, columns=all_weeks, fill_value=0)
# Create the heatmap
plt.figure(figsize=(20, 4))
sns.heatmap(heatmap_data, cmap='Greens', linewidths=.5, linecolor='gray', cbar_kws={'label': 'XP Earned'})
# Set the labels
plt.title('XP Earned Activity Heatmap', loc='center')
plt.xlabel('Week of the Year')
plt.ylabel('Day of the Week')
plt.yticks(ticks=np.arange(7) + 0.5, labels=['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'], rotation=0)
# Display the heatmap
plt.show()2️⃣ Now make it your own!
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
# Read in the data
xp_earned = pd.read_csv('data/xp_earned.csv', parse_dates=['earned_at'])
# Ensure the 'earned_at' column is in datetime format
xp_earned['earned_at'] = pd.to_datetime(xp_earned['earned_at'])
# Add a year column for filtering
xp_earned['year'] = xp_earned['earned_at'].dt.year
# Filter for data from 2025
xp_earned_2025 = xp_earned[xp_earned['year'] == 2025]
# Create columns for week number and day of the week
xp_earned_2025['week'] = xp_earned_2025['earned_at'].dt.isocalendar().week
xp_earned_2025['day'] = xp_earned_2025['earned_at'].dt.dayofweek
# Define weekly XP milestone (e.g., 500 XP per week)
weekly_goal = 500
# Sum XP earned for each week
weekly_xp = xp_earned_2025.groupby('week')['xp_amount'].sum()
# Ensure weeks with no XP earned are filled with 0
all_weeks = range(1, 53)
weekly_xp = weekly_xp.reindex(all_weeks, fill_value=0)
# Identify weeks where milestones are met or exceeded
milestone_weeks = weekly_xp >= weekly_goal
# Create a DataFrame for visualization
heatmap_data = xp_earned_2025.pivot_table(index='day', columns='week', values='xp_amount', aggfunc='sum', fill_value=0)
# Reindex to ensure all days and weeks are represented
all_days = range(0, 7) # Days 0 (Monday) to 6 (Sunday)
heatmap_data = heatmap_data.reindex(index=all_days, columns=all_weeks, fill_value=0)
# Create the heatmap
plt.figure(figsize=(20, 4))
sns.heatmap(
heatmap_data,
cmap='Blues',
linewidths=0.5,
linecolor='gray',
cbar_kws={'label': 'XP Earned'}
)
# Annotate milestones directly on the heatmap
for week in milestone_weeks[milestone_weeks].index:
plt.text(
x=week - 1,
y=-0.5,
s='★',
color='red',
fontsize=12,
ha='center'
)
# Set the labels
plt.title('2025 XP Milestone Heatmap', loc='center')
plt.xlabel('Week of the Year')
plt.ylabel('Day of the Week')
plt.yticks(
ticks=np.arange(7) + 0.5,
labels=['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'],
rotation=0
)
# Display the heatmap
plt.show()
# Summary output for progress
total_xp_2025 = weekly_xp.sum()
met_goals = milestone_weeks.sum()
print(f"Total XP earned in 2025: {total_xp_2025}")
print(f"Weeks where milestones were met: {met_goals}")
print(f"Weeks remaining to hit milestones: {52 - met_goals}")🗓️ Challenge 2: Track Your Habits
Track your learning streaks: Use the streaks data to find your longest streak in 2024. Reflect on the strategies that helped you stay consistent and apply them to maintain or extend streaks in 2025.
Fun fact, learners who extend their daily streak by just two days are 18x more likely to complete a Career/Skill Track.
import pandas as pd
# Load streaks data
streaks = pd.read_csv('data/streaks.csv', parse_dates=['streak_started_at', 'streak_ended_at'])
# Filter streaks that fall within the year 2024
streaks_2024 = streaks[
(streaks['streak_started_at'] >= '2024-01-01') & (streaks['streak_ended_at'] <= '2024-12-31')
]
# Calculate streak length for each streak (in days)
streaks_2024['streak_length'] = (streaks_2024['streak_ended_at'] - streaks_2024['streak_started_at']).dt.days + 1
# Find the longest streak
longest_streak = streaks_2024['streak_length'].max()
# Display the longest streak and corresponding details
longest_streak_details = streaks_2024[streaks_2024['streak_length'] == longest_streak]
print("Longest streak in 2024:", longest_streak)
print("Details of the longest streak:\n", longest_streak_details)🐾 Challenge 3: Set Next Steps
Identify your most productive days: Analyze the learning_minutes data to find which day(s) of the week you dedicated the most time to learning. Consider setting goals for 2025 to make these days even more productive, or identify new days to focus on learning.
# Load learning minutes data
learning_minutes = pd.read_csv('data/learning_minutes.csv', parse_dates=['date'])
# Extract the day of the week from the date
learning_minutes['day_of_week'] = learning_minutes['date'].dt.day_name()
# Group by day of the week and sum the total duration in minutes
total_minutes_per_day = learning_minutes.groupby('day_of_week')['total_duration_in_minutes'].sum()
# Sort the days of the week in the correct order
days_order = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday']
total_minutes_per_day = total_minutes_per_day.reindex(days_order)
# Find the day with the maximum learning minutes
most_productive_day = total_minutes_per_day.idxmax()
most_productive_minutes = total_minutes_per_day.max()
# Display the total minutes per day and the most productive day
total_minutes_per_day, most_productive_day, most_productive_minutes