The is_month_start
attribute of Pandas.Timestamp, which is an equivalent of Python's date time-object, is used to check if a given date is the first day of the month or not.
The is_month_start
attribute takes the syntax below:
Timestamp.is_month_start
As an attribute, is_month_start
takes no parameter value.
The is_month_start
attribute returns a Boolean value indicating if the date is the first day of the month (if True
) or not (if False
).
# A code to illustrate the .is_month_start attribute in Pandas# importing the pandas libraryimport pandas as pd# creating Timestamp objectsa = pd.Timestamp(2022, 4, 1)b = pd.Timestamp(2022, 4, 30)# checking if the dates is or are the first day of the month of Aprilprint(a.is_month_end)print(b.is_month_end)
a
and b
.a
and b
is the first day of the month, using the is_month_start
attribute.