Skip to content

Add timetz attribute to DatetimeIndex #22132

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

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
4265cff
ENH: Added timetz attribute to DatetimeIndex. GH21358
jequinon Jul 28, 2018
6e9ce28
Merge remote-tracking branch 'upstream/master' into Add_timetz_to_Dat…
jequinon Jul 28, 2018
2966176
DOC: Changed method, class, and api.rst doc to add timetz to Datetime…
jequinon Jul 28, 2018
c972de7
TST: Added a test for DatetimeIndex.timetz. GH21358
jequinon Jul 28, 2018
4473e7c
Fixed style errors
jequinon Jul 29, 2018
d51e0c1
Fixed spacing on test
jequinon Jul 30, 2018
1dd2c78
Merge remote-tracking branch 'upstream/master' into Add_timetz_to_Dat…
jequinon Jul 30, 2018
b4af058
Added whatsnew entry
jequinon Jul 30, 2018
028b05d
Added attribute tag to whatsnew
jequinon Jul 30, 2018
5185552
Fixed another spacing mistake
jequinon Jul 30, 2018
8878613
Updated docs and changed test to use tz_naive_fixture
jequinon Jul 31, 2018
368165b
Merge remote-tracking branch 'upstream/master' into Add_timetz_to_Dat…
jequinon Jul 31, 2018
baf8883
Added test comparing Timestamp.tz with datetime.tz
jequinon Jul 31, 2018
9227e35
Merge remote-tracking branch 'upstream/master' into Add_timetz_to_Dat…
jequinon Jul 31, 2018
f94cb13
Bump because build is failing unexpectedly
jequinon Jul 31, 2018
18bb0b7
Merge remote-tracking branch 'upstream/master' into Add_timetz_to_Dat…
jequinon Aug 2, 2018
659643c
ENH: Added timetz to Series.dt. Also added a test and changed docs
jequinon Aug 2, 2018
ec5a295
Made small change dt accessor test
jequinon Aug 2, 2018
17547ce
Merge remote-tracking branch 'upstream/master' into Add_timetz_to_Dat…
jequinon Aug 2, 2018
e711f6c
Merge remote-tracking branch 'upstream/master' into Add_timetz_to_Dat…
jequinon Aug 3, 2018
6cfa9a1
Merge remote-tracking branch 'upstream/master' into Add_timetz_to_Dat…
jequinon Aug 3, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fixed style errors
  • Loading branch information
jequinon committed Jul 29, 2018
commit 4473e7cdb3214cce2bc9a86d2891d813d37ff988
2 changes: 1 addition & 1 deletion pandas/core/arrays/datetimes.py
Original file line number Diff line number Diff line change
Expand Up @@ -844,7 +844,7 @@ def time(self):
@property
def timetz(self):
"""
Returns numpy array of datetime.time also containing timezone
Returns numpy array of datetime.time also containing timezone
information. The time part of the Timestamps.
"""
return tslib.ints_to_pydatetime(self.asi8, self.tz, box="time")
Expand Down
3 changes: 2 additions & 1 deletion pandas/tests/indexes/datetimes/test_timezones.py
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,8 @@ def test_time_accessor(self, dtype):
tm.assert_numpy_array_equal(result, expected)

@pytest.mark.parametrize('tz', [
dateutil.tz.gettz('US/Eastern'), dateutil.tz.gettz('US/Pacific'), dateutil.tz.gettz('UTC')])
dateutil.tz.gettz('US/Eastern'), dateutil.tz.gettz('US/Pacific'),
dateutil.tz.gettz('UTC')])
def test_timetz_accessor(self, tz):
Copy link
Member

Choose a reason for hiding this comment

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

Instead could you use the tz_naive_fixture?

def tz_naive_fixture(request):

# GH21358
expected = np.array([time(10, 20, 30, tzinfo=tz), pd.NaT])
Expand Down