-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
day_of_week #26094
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
day_of_week #26094
Changes from all commits
c62db4d
26f7bf7
5b62982
cdd3f54
356b266
a336b2b
b9e40b6
ede24ef
51a9a48
e8bf846
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,7 +44,10 @@ def time_tz(self, tz, freq): | |
self.ts.tz | ||
|
||
def time_dayofweek(self, tz, freq): | ||
self.ts.dayofweek | ||
self.ts.day_of_week | ||
|
||
def time_day_of_week(self, tz, freq): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. indent error here |
||
self.ts.day_of_week | ||
|
||
def time_weekday_name(self, tz, freq): | ||
self.ts.day_name | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -527,7 +527,8 @@ generated/pandas.DatetimeIndex.ceil,../reference/api/pandas.DatetimeIndex.ceil | |
generated/pandas.DatetimeIndex.date,../reference/api/pandas.DatetimeIndex.date | ||
generated/pandas.DatetimeIndex.day,../reference/api/pandas.DatetimeIndex.day | ||
generated/pandas.DatetimeIndex.day_name,../reference/api/pandas.DatetimeIndex.day_name | ||
generated/pandas.DatetimeIndex.dayofweek,../reference/api/pandas.DatetimeIndex.dayofweek | ||
generated/pandas.DatetimeIndex.dayofweek,../reference/api/pandas.DatetimeIndex.day_of_week | ||
generated/pandas.DatetimeIndex.day_of_week,../reference/api/pandas.DatetimeIndex.day_of_week | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i don't think you need to add the new one, we don't have original pages for it |
||
generated/pandas.DatetimeIndex.dayofyear,../reference/api/pandas.DatetimeIndex.dayofyear | ||
generated/pandas.DatetimeIndex.floor,../reference/api/pandas.DatetimeIndex.floor | ||
generated/pandas.DatetimeIndex.freq,../reference/api/pandas.DatetimeIndex.freq | ||
|
@@ -1004,7 +1005,8 @@ generated/pandas.Panel.where,../reference/api/pandas.Panel.where | |
generated/pandas.Panel.xs,../reference/api/pandas.Panel.xs | ||
generated/pandas.Period.asfreq,../reference/api/pandas.Period.asfreq | ||
generated/pandas.Period.day,../reference/api/pandas.Period.day | ||
generated/pandas.Period.dayofweek,../reference/api/pandas.Period.dayofweek | ||
generated/pandas.Period.dayofweek,../reference/api/pandas.Period.day_of_week | ||
generated/pandas.Period.day_of_week,../reference/api/pandas.Period.day_of_week | ||
generated/pandas.Period.dayofyear,../reference/api/pandas.Period.dayofyear | ||
generated/pandas.Period.days_in_month,../reference/api/pandas.Period.days_in_month | ||
generated/pandas.Period.daysinmonth,../reference/api/pandas.Period.daysinmonth | ||
|
@@ -1015,7 +1017,8 @@ generated/pandas.Period.hour,../reference/api/pandas.Period.hour | |
generated/pandas.Period,../reference/api/pandas.Period | ||
generated/pandas.PeriodIndex.asfreq,../reference/api/pandas.PeriodIndex.asfreq | ||
generated/pandas.PeriodIndex.day,../reference/api/pandas.PeriodIndex.day | ||
generated/pandas.PeriodIndex.dayofweek,../reference/api/pandas.PeriodIndex.dayofweek | ||
generated/pandas.PeriodIndex.dayofweek,../reference/api/pandas.PeriodIndex.day_of_week | ||
generated/pandas.PeriodIndex.day_of_week,../reference/api/pandas.PeriodIndex.day_of_week | ||
generated/pandas.PeriodIndex.dayofyear,../reference/api/pandas.PeriodIndex.dayofyear | ||
generated/pandas.PeriodIndex.days_in_month,../reference/api/pandas.PeriodIndex.days_in_month | ||
generated/pandas.PeriodIndex.daysinmonth,../reference/api/pandas.PeriodIndex.daysinmonth | ||
|
@@ -1161,7 +1164,8 @@ generated/pandas.Series.dt.components,../reference/api/pandas.Series.dt.componen | |
generated/pandas.Series.dt.date,../reference/api/pandas.Series.dt.date | ||
generated/pandas.Series.dt.day,../reference/api/pandas.Series.dt.day | ||
generated/pandas.Series.dt.day_name,../reference/api/pandas.Series.dt.day_name | ||
generated/pandas.Series.dt.dayofweek,../reference/api/pandas.Series.dt.dayofweek | ||
generated/pandas.Series.dt.dayofweek,../reference/api/pandas.Series.dt.day_of_week | ||
generated/pandas.Series.dt.day_of_week,../reference/api/pandas.Series.dt.day_of_week | ||
generated/pandas.Series.dt.dayofyear,../reference/api/pandas.Series.dt.dayofyear | ||
generated/pandas.Series.dt.days,../reference/api/pandas.Series.dt.days | ||
generated/pandas.Series.dt.days_in_month,../reference/api/pandas.Series.dt.days_in_month | ||
|
@@ -1506,7 +1510,8 @@ generated/pandas.Timestamp.ctime,../reference/api/pandas.Timestamp.ctime | |
generated/pandas.Timestamp.date,../reference/api/pandas.Timestamp.date | ||
generated/pandas.Timestamp.day,../reference/api/pandas.Timestamp.day | ||
generated/pandas.Timestamp.day_name,../reference/api/pandas.Timestamp.day_name | ||
generated/pandas.Timestamp.dayofweek,../reference/api/pandas.Timestamp.dayofweek | ||
generated/pandas.Timestamp.dayofweek,../reference/api/pandas.Timestamp.day_of_week | ||
generated/pandas.Timestamp.day_of_week,../reference/api/pandas.Timestamp.day_of_week | ||
generated/pandas.Timestamp.dayofyear,../reference/api/pandas.Timestamp.dayofyear | ||
generated/pandas.Timestamp.days_in_month,../reference/api/pandas.Timestamp.days_in_month | ||
generated/pandas.Timestamp.daysinmonth,../reference/api/pandas.Timestamp.daysinmonth | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -60,6 +60,7 @@ Properties | |
Timestamp.asm8 | ||
Timestamp.day | ||
Timestamp.dayofweek | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you can remove the original from the docs |
||
Timestamp.day_of_week | ||
Timestamp.dayofyear | ||
Timestamp.days_in_month | ||
Timestamp.daysinmonth | ||
|
@@ -223,6 +224,7 @@ Properties | |
|
||
Period.day | ||
Period.dayofweek | ||
Period.day_of_week | ||
Period.dayofyear | ||
Period.days_in_month | ||
Period.daysinmonth | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -138,7 +138,7 @@ Bug Fixes | |
- Bug where ``Panel.from_dict`` does not set dtype when specified (:issue:`10058`) | ||
- Bug in ``Index.union`` raises ``AttributeError`` when passing array-likes. (:issue:`10149`) | ||
- Bug in ``Timestamp``'s' ``microsecond``, ``quarter``, ``dayofyear``, ``week`` and ``daysinmonth`` properties return ``np.int`` type, not built-in ``int``. (:issue:`10050`) | ||
- Bug in ``NaT`` raises ``AttributeError`` when accessing to ``daysinmonth``, ``dayofweek`` properties. (:issue:`10096`) | ||
- Bug in ``NaT`` raises ``AttributeError`` when accessing to ``daysinmonth``, ``dayofweek``, ``day_of_week`` properties. (:issue:`10096`) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. don't change the original what's new notes |
||
- Bug in Index repr when using the ``max_seq_items=None`` setting (:issue:`10182`). | ||
- Bug in getting timezone data with ``dateutil`` on various platforms ( :issue:`9059`, :issue:`8639`, :issue:`9663`, :issue:`10121`) | ||
- Bug in displaying datetimes with mixed frequencies; display 'ms' datetimes to the proper precision. (:issue:`10170`) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1957,6 +1957,57 @@ cdef class _Period(object): | |
""" | ||
return self.weekofyear | ||
|
||
@property | ||
def day_of_week(self): | ||
""" | ||
Day of the week the period lies in, with Monday=0 and Sunday=6. | ||
|
||
If the period frequency is lower than daily (e.g. hourly), and the | ||
period spans over multiple days, the day at the start of the period is | ||
used. | ||
|
||
If the frequency is higher than daily (e.g. monthly), the last day | ||
of the period is used. | ||
|
||
Returns | ||
------- | ||
int | ||
Day of the week. | ||
|
||
See Also | ||
-------- | ||
Period.day_of_week : Day of the week the period lies in. | ||
Period.weekday : Alias of Period.day_of_week. | ||
Period.day : Day of the month. | ||
Period.dayofyear : Day of the year. | ||
|
||
Examples | ||
-------- | ||
>>> per = pd.Period('2017-12-31 22:00', 'H') | ||
>>> per.day_of_week | ||
6 | ||
|
||
For periods that span over multiple days, the day at the beginning of | ||
the period is returned. | ||
|
||
>>> per = pd.Period('2017-12-31 22:00', '4H') | ||
>>> per.day_of_week | ||
6 | ||
>>> per.start_time.day_of_week | ||
6 | ||
|
||
For periods with a frequency higher than days, the last day of the | ||
period is returned. | ||
|
||
>>> per = pd.Period('2018-01', 'M') | ||
>>> per.day_of_week | ||
2 | ||
>>> per.end_time.day_of_week | ||
2 | ||
""" | ||
base, mult = get_freq_code(self.freq) | ||
return pweekday(self.ordinal, base) | ||
|
||
@property | ||
def dayofweek(self): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. just do dayofweek = day_of_week |
||
""" | ||
|
@@ -1976,7 +2027,7 @@ cdef class _Period(object): | |
|
||
See Also | ||
-------- | ||
Period.dayofweek : Day of the week the period lies in. | ||
Period.day_of_week : Day of the week the period lies in. | ||
Period.weekday : Alias of Period.dayofweek. | ||
Period.day : Day of the month. | ||
Period.dayofyear : Day of the year. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can remove the original one