date#
- class date(*args, **kwargs)[source]#
Bases:
TimestampDefine a single date; based on
pd.Timestamp- Parameters:
date (int/float/str/datetime) – Any type of date input (ints and floats will be interpreted as years)
kwargs (dict) – passed to pd.Timestamp()
Examples:
ss.date(2020) # Returns <2020-01-01> ss.date(year=2020) # Returns <2020-01-01> ss.date(year=2024.75) # Returns <2024-10-01> ss.date('2024-04-04') # Returns <2024-04-04> ss.date(year=2024, month=4, day=4) # Returns <2024-04-04>
Attributes
asm8Return numpy datetime64 format in nanoseconds.
dayday_of_weekReturn day of the week.
day_of_yearReturn the day of the year.
dayofweekReturn day of the week.
dayofyearReturn the day of the year.
days_in_monthReturn the number of days in the month.
daysinmonthReturn the number of days in the month.
foldhouris_leap_yearReturn True if year is a leap year.
is_month_endCheck if the date is the last day of the month.
is_month_startCheck if the date is the first day of the month.
is_quarter_endCheck if date is last day of the quarter.
is_quarter_startCheck if the date is the first day of the quarter.
is_year_endReturn True if date is last day of the year.
is_year_startReturn True if date is first day of the year.
maxmicrosecondminminutemonthnanosecondquarterReturn the quarter of the year.
resolutionsecondtzAlias for tzinfo.
tzinfounitThe abbreviation associated with self._creso.
valueweekReturn the week number of the year.
weekofyearReturn the week number of the year.
yearMethods
- classmethod from_year(year)[source]#
Convert an int or float year to a date.
Examples:
ss.date.from_year(2020) # Returns <2020-01-01> ss.date.from_year(2024.75) # Returns <2024-10-01>