Quarterly Exhaustion: Which Genres Drain Your Brain?

Day 47 of 100 Days Coding Challenge: Python

I read for all kinds of reasons—personal growth, research, curiosity, or just to escape reality for a few hundred pages. And because of that, my bookshelf looks like it belongs to someone with multiple personalities. I’ve always known that I gravitate toward science fiction and fantasy (Stormlight Archive, anyone?), but lately I’ve had a sneaking suspicion: fantasy books might secretly be way longer than anything else.

So today, I decided to test that theory by adding a feature to calculate the average number of pages per genre per quarter. If fantasy is the literary equivalent of leg day, I want to know. And if I’m dragging by the end of Q3, it’s probably Brandon Sanderson’s fault.

Today’s Motivation / Challenge

You know that feeling when you finish a 900-page fantasy tome and think, “Why am I so tired?” Well, data can tell you why. Today’s challenge was to turn that vague feeling into a measurable trend. Think of it like a quarterly report—but instead of sales revenue, we’re analyzing book-induced fatigue.

Purpose of the Code (Object)

This code analyzes your reading log and breaks down the average number of pages you’ve read per genre, grouped by quarter. It helps you discover seasonal trends in your reading habits—like whether you go hard on historical fiction in spring or slow-burn through sci-fi during winter.

AI Prompt:

Add the function to calculate the average page count per Genre, grouped by quarter.

Functions & Features

  • Calculates average page count per genre, grouped by quarter
  • Displays the data in both printed table form and as a bar chart
  • Helps you discover which genres are “page-heavy” per season
  • Adds one more analytical layer to your personal book dashboard

Requirements / Setup

pip install pandas matplotlib

Minimal Code Sample

df[‘Quarter’] = df[‘Date Finished’].dt.to_period(‘Q’)

avg_pages = df.groupby([‘Quarter’, ‘Genre’])[‘Pages’].mean().unstack().fillna(0)

avg_pages.round(1).plot(kind=’bar’)

This snippet groups books by quarter and genre, calculates the average pages, and plots a bar chart.

Book Tracker

Notes / Lessons Learned

I’m officially over my fear of virtual environments—no more mysterious typos or wondering why the environment won’t activate. Adding this new function was pretty smooth. One thing I still find slightly annoying is juggling the menu options. Now that “exit” is option 7 and this new analysis is 8, my orderly brain twitches a little. But hey, renumbering is just cosmetic, right?

Honestly, the more I work on this program, the more I feel like it’s becoming mine. I’m not just learning Python anymore—I’m building something I actually want to use. That’s got to be the most rewarding part. Well, that and finally proving that fantasy books are absolute beasts.

Optional Ideas for Expansion

  • Let users filter by author to see who writes the longest tomes
  • Export the genre-per-quarter averages to a CSV file for archiving
  • Add a “reading fatigue index” based on total pages per week

Leave a Reply

Your email address will not be published. Required fields are marked *