Skip to content

ENH: GH11128 add weekday_name to DatetimeIndex and .dt #12803

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

Closed
wants to merge 3 commits into from

Conversation

BastiaanBergman
Copy link

closes #11128
replaces #11813

  • tests added / passed
  • passes git diff upstream/master | flake8 --diff
  • whatsnew entry

Completed merge of Bahrunnur's PR 'weekday-name'
Moved 'enhancements' to v0.18.1.txt
Added tests to pandas/tests/series/test_datetime_values.py
Added weekday_name property producing 'NaT' to NaTType class

	Completed merge of Bahrunnur's PR 'weekday-name'
	Moved 'enhancements' to v0.18.1.txt
	Added tests to pandas/tests/series/test_datetime_values.py
	Added weekday_name property producing 'NaT' to NaTType class
 Author:    BastiaanBergman <Bastiaan.Bergman@gmailcom>
@jreback jreback added Enhancement Datetime Datetime data dtype labels Apr 5, 2016
@@ -469,6 +469,7 @@ These can be accessed like ``Series.dt.<property>``.
Series.dt.days_in_month
Series.dt.tz
Series.dt.freq
Series.dt.weekday_name
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you move after .weekday

@jreback jreback added this to the 0.18.1 milestone Apr 5, 2016
@@ -32,7 +32,7 @@ def test_ops_properties(self):
'is_month_start', 'is_month_end',
'is_quarter_start',
'is_quarter_end', 'is_year_start',
'is_year_end'],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there are addl tests in tests/series/test_datetime_values.py (just add the new propery name)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, and they were added to in my original PR.

@jreback
Copy link
Contributor

jreback commented Apr 5, 2016

looks good. just some minor points.

come to think of it, prob should add month_name as well I guess. Then of course there is the locale (IOW, we really should return a locale based string for the weekdays). issue. Can you make an issue for these 2 things?

@jreback
Copy link
Contributor

jreback commented Apr 5, 2016

I think we can just instantiate the LocaleTime() object when this module is imported. Not really sure why that wouldn't work, you can try it if you want. This should really be a singleton type object, e.g.

locale_time = LocalTime()

then use locale_time

-Moved to group .weekday_name next to .weekday in docs
-Added Timestamp test to tseries/tests/test_timeseries.py
-Change dtype of weekday_name to np.object_
@@ -25,7 +25,7 @@ class TestSeriesDatetimeValues(TestData, tm.TestCase):

def test_dt_namespace_accessor(self):

# GH 7207
# GH 7207, 11128
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean add it here as well

@jreback
Copy link
Contributor

jreback commented Apr 6, 2016

ok this looks good. I'd like to use the LocaleTime() object as I described (should be cached) to return the locale specific names here.

@jreback
Copy link
Contributor

jreback commented Apr 6, 2016

xref #12806

@jreback
Copy link
Contributor

jreback commented Apr 17, 2016

can you try adding this with the LocaleTimesupport?

@BastiaanBergman
Copy link
Author

Yes, just need to find the time, maybe later this week.
On Apr 17, 2016 8:46 AM, "Jeff Reback" [email protected] wrote:

can you try adding this with the LocaleTimesupport?


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#12803 (comment)

@jreback
Copy link
Contributor

jreback commented Apr 17, 2016

@BastiaanBergman ok, great thanks

@jreback
Copy link
Contributor

jreback commented Apr 25, 2016

@jorisvandenbossche comments?

I guess we can address using LocaleTime() later.

@BastiaanBergman
Copy link
Author

Sorry, didn't get to it, will try again late May.

@jorisvandenbossche
Copy link
Member

Looks good

@jreback jreback closed this in afddc4f Apr 26, 2016
jreback added a commit that referenced this pull request Apr 26, 2016
@jreback
Copy link
Contributor

jreback commented Apr 26, 2016

thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Datetime Datetime data dtype Enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ENH: add weekday_name to DatetimeIndex and .dt
4 participants