np.random.seed(0)
weekday = np.random.randint(0, 7, N)
week = np.random.randint(0, 40, N)
activity = np.random.randint(0, 100, N)
df = pd.DataFrame({'weekday': weekday, 'week': week, 'activity': activity})
df.drop_duplicates(subset=['weekday', 'week'], inplace=True)
df2 = df.pivot(columns='week', index='weekday', values='activity')
df2.fillna(0, inplace=True)
Weekday, Week = np.mgrid[:df2.shape[0] + 1, :df2.shape[1] + 1]
fig, ax = pl.subplots(figsize=(12, 4))
ax.set_aspect('equal')
pl.pcolormesh(Week, Weekday, df2.values, cmap='Greens', edgecolor='w', vmin
    =-10, vmax=100)
pl.xlim(0, df2.shape[1])
Как создать график активности из Pandas Dataframe (например, график вклада Github)