DatetimeIndex.is_year_start
Pandas DatetimeIndex.is_year_start
is an indicator of whether a date is the first day of the year. If the date — the first day of the year, it returns True
otherwise it returns False
.
Syntax: DatetimeIndex.is_year_start
Return: numpy array containing logical values.
Example # 1: Use the DatetimeIndex.is_year_start
to check if the dates in the DatetimeIndex are the first day of the year.
|
Output:
Now we want to find out if the dates contained in this DatetimeIndex are the first day of the year.
|
Output:
As we can see in the output, the function returned an empty array containing boolean values for each entry in the DatetimeIndex object. True
values indicate that the corresponding date was the first day of the year, and False
values indicate that the corresponding date was not the first day of the year.
Example # 2: Use the DatetimeIndex.is_year_start
attribute to check if the dates present in the DatetimeIndex object are the first day of the year.
< code class = "undefined spaces"> |
Output:
Now we want to find out if the dates are contained in this DatetimeIndex object, the first day of the year.
|
Exit :
As we can see in the output, the function returned an empty array containing boolean values for each record of the DatetimeIndex object. True
values indicate that the corresponding date was the first day of the year, and False
values indicate that the corresponding date was not the first day of the year.