Series.dt
can be used to access series values as datetimelike and return multiple properties. Series.dt.daysinmonth
Pandas Series.dt.daysinmonth
returns the number of days in a month for a given series object.
Syntax: Series.dt.daysinmonth
Parameter: None
Returns: numpy array
Example # 1: Use the Series.dt.daysinmonth
attribute to find the number of days in a month given date in the series object.
|
Output:
We will now use the Series.dt.daysinmonth
attribute to find the number of days in a month for a given date.
|
Output:
As we can see from the output, the Series.dt.daysinmonth
attribute successfully accessed and returned the number of days in the month for the given date.
Example # 2: Use the Series attribute .dt.daysinmonth
to find the number of days in the month of a given date in a series object.
# Create series |
Exit :
Now we will use the Series.dt.daysinmonth
attribute to find the number of days in a month for a given date.
|
Output:
How we can see from the output that the Series.dt.daysinmonth
attribute successfully accessed and returned the number of days in the month for the given date.