The is_month_end
attribute in pandas.Timestamp
(an equivalent of Python's DateTime object) is used to check if the given date is the last day of the month.
Timestamp.is_month_end
This attribute takes no parameter value.
This attribute returns a Boolean value. It returns True
to indicate that the date is the last day of the month. Otherwise, it returns False
.
# A code to illustrate the .is_month_end attribute in Pandas # importing the pandas library import pandas as pd # creating Timestamp objects a = pd.Timestamp(2022, 4, 19) b = pd.Timestamp(2022, 4, 30) # checking if the dates is or are the last day of the month of April print(a.is_month_end) print(b.is_month_end)
pandas
library.a
and b
.a
and b
is the last day of the month using the is_month_end
attribute.RELATED TAGS
CONTRIBUTOR
View all Courses