Python | Pandas DatetimeIndex.is_year_end Last Updated : 24 Dec, 2018 Comments Improve Suggest changes Like Article Like Report Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric python packages. Pandas is one of those packages and makes importing and analyzing data much easier. Pandas DatetimeIndex.is_year_end attribute is an indicator for whether the date is the last day of the year. If the date is the last day of the year it returns True else it return False. Syntax: DatetimeIndex.is_year_end Returns: numpy array containing logical values. Example #1: Use DatetimeIndex.is_year_end attribute to check if the dates present in the DatetimeIndex object is the last day of the year. Python3 # importing pandas as pd import pandas as pd # Create the DatetimeIndex didx = pd.DatetimeIndex(['2014-01-01', '2014-12-31', '2017-03-31', '2000-12-31']) # Print the DatetimeIndex print(didx) Output : Now we want to find if the dates contained in the given DatetimeIndex object is the last day of the year. Python3 # find if the days are the last day of the year. didx.is_year_end Output : As we can see in the output, the function has returned a numpy array containing logical values for each entry of the DatetimeIndex object. True values indicate the corresponding date was the last day of the year and False value indicate the corresponding date was not the last day of the year. Example #2: Use DatetimeIndex.is_year_end attribute to check if the dates present in the DatetimeIndex object is the last day of the year. Python3 # importing pandas as pd import pandas as pd # Create the DatetimeIndex didx = pd.date_range("2017-12-30", periods = 5) # Print the DatetimeIndex print(didx) Output : Now we want to find if the dates contained in the given DatetimeIndex object is the last day of the year. Python3 # find if the days are the last day of the year. didx.is_year_end Output : As we can see in the output, the function has returned a numpy array containing logical values for each entry of the DatetimeIndex object. True values indicate the corresponding date was the last day of the year and False value indicate the corresponding date was not the last day of the year. Comment More infoAdvertise with us Next Article Python | Pandas DatetimeIndex.is_year_end S Shubham__Ranjan Follow Improve Article Tags : Technical Scripter Python Python-pandas Python pandas-datetimeIndex Practice Tags : python Similar Reads Python | Pandas DatetimeIndex.is_quarter_end Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric python packages. Pandas is one of those packages and makes importing and analyzing data much easier. Pandas DatetimeIndex.is_quarter_end attribute is an indicator for whether the date is 2 min read Python | Pandas DatetimeIndex.year Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric python packages. Pandas is one of those packages and makes importing and analyzing data much easier. Pandas DatetimeIndex.year attribute outputs an Index object containing the value of ye 2 min read Python | Pandas DatetimeIndex.is_leap_year Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric python packages. Pandas is one of those packages and makes importing and analyzing data much easier. Pandas DatetimeIndex.is_leap_year attribute return a boolean indicator if the date bel 2 min read Python | Pandas DatetimeIndex.is_year_start Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric python packages. Pandas is one of those packages and makes importing and analyzing data much easier. Pandas DatetimeIndex.is_year_start attribute is an indicator for whether the date is t 2 min read Python | Pandas DatetimeIndex.is_month_end Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric python packages. Pandas is one of those packages and makes importing and analyzing data much easier. Pandas DatetimeIndex.is_month_end attribute returns a numpy array containing logical v 2 min read Python | Pandas DatetimeIndex.day Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric python packages. Pandas is one of those packages and makes importing and analyzing data much easier. Pandas DatetimeIndex.day attribute outputs an Index object containing the days in each 2 min read Python | Pandas DatetimeIndex.is_quarter_start Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric python packages. Pandas is one of those packages and makes importing and analyzing data much easier. Pandas DatetimeIndex.is_quarter_start attribute is an indicator for whether the date i 2 min read Python | Pandas DatetimeIndex.time Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric python packages. Pandas is one of those packages and makes importing and analyzing data much easier. Pandas DatetimeIndex.time attribute outputs an Index object containing the time values 2 min read Python | Pandas DatetimeIndex.freq Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric python packages. Pandas is one of those packages and makes importing and analyzing data much easier. Pandas DatetimeIndex.freq attribute returns the frequency object if it is set in the D 2 min read Python | Pandas DatetimeIndex.is_month_start Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric python packages. Pandas is one of those packages and makes importing and analyzing data much easier. Pandas DatetimeIndex.is_month_start attribute returns a numpy array containing logical 2 min read Like