liveBook · Manning

Is_quarter_end

As explained in Pandas Workout: 200 exercises to make you a stronger data analyst

A pandas datetime property that returns Boolean values indicating whether datetime labels fall on the last day of a calendar quarter.

Use is_quarter_end to identify datetime labels that fall on the final day of a calendar quarter. Applied directly to a DatetimeIndex, it returns Boolean values that can select quarter-end rows. section 10.10

Select quarter-end oil prices

Given a daily oil-price dataframe indexed by parsed dates, evaluate df.index.is_quarter_end and use the resulting Boolean series as a mask: df.loc[df.index.is_quarter_end]. The result contains rows dated at each quarter’s end, whether that date is the 30th or 31st. section 10.10

Extend the task by:

  • Comparing explicit quarter-end selection with resample for period-level summaries. section 10.10

How Pandas Workout: 200 exercises to make you a stronger data analyst covers it

How deep it goes
Explains direct DatetimeIndex use, Boolean-mask selection, and calendar-date behavior without detailing implementation internals.
Examples
Uses daily oil prices, a DatetimeIndex Boolean mask, and selected quarter-end rows.
What it assumes
Assumes familiarity with pandas indexes, datetime values, and Boolean masking.
What you can do after
Apply via pandas to filter a time-indexed dataframe down to quarter-end observations.
How it connects
Connects datetime indexing, Boolean masking, and time-series resampling.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Pandas Workout: 200 exercises to make you a stronger data analyst. The section links point to the parts of the book it draws on.