Skip to Content

Pandas – Check if Date is the First Day of a Quarter

The datetime type in pandas comes with a number of useful built-in functions to get additional information about the given date. In this tutorial, we will look at how to check if a date in a pandas dataframe is the first day of a quarter or not with the help of some examples.

Using the is_quarter_start attribute

check if date is the first day of a quarter in pandas

You can use is_quarter_start attribute on a pandas series (or a column in a dataframe) containing datetime values with the help the .dt accessor to check if each date is the first date of a quarter or not.

The following is the syntax –


It returns a boolean pandas series where True represents that the corresponding date is the start date of the quarter and False represents that it’s not.


Let’s now look at some examples of using the above syntax.

First, we will create a sample dataframe to apply the above method.

import pandas as pd

# create a dataframe
df = pd.DataFrame({
    "Date": pd.date_range("2023-03-26", "2023-04-04"),
    "Sales": [10, 12, 7, 17, 21, 5, 11, 13, 14, 8]

# display the dataframe


the resulting dataframe with date level sales data

Here, we created a dataframe with the date level sales data for an ecommerce website. Notice, we used the pandas date_range() function to get datetime values from “2022-03-26” to “2022-04-04” (both inclusive).

Let’s now check whether the dates in the “Date” represent the first day of a quarter or not.



0    False
1    False
2    False
3    False
4    False
5    False
6     True
7    False
8    False
9    False
Name: Date, dtype: bool

We get a pandas series of boolean values. Notice that we get True for the date “2023-04-01” which, in fact, is the first day of a quarter (April to June).

Let’s add the result from the is_quarter_start attribute as an additional column in the above dataframe.

# add new column
df["Is First Day of Quarter"] = df["Date"].dt.is_quarter_start
# display the dataframe


dataframe with a new column "Is First Day of Quarter"

You might also be interested in –

Subscribe to our newsletter for more informative guides and tutorials.
We do not spam and you can opt out any time.


  • Piyush Raj

    Piyush is a data professional passionate about using data to understand things better and make informed decisions. He has experience working as a Data Scientist in the consulting domain and holds an engineering degree from IIT Roorkee. His hobbies include watching cricket, reading, and working on side projects.