Skip to content

Commit 39a12ef

Browse files
author
y-p
committed
Merge pull request #5722 from TomAugspurger/datetimeIndex-name-doc
DOC: DatetimeIndex accepts name param
2 parents 5d6bbe8 + 6816dd8 commit 39a12ef

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

pandas/tseries/index.py

+2
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,8 @@ class DatetimeIndex(Int64Index):
119119
closed : string or None, default None
120120
Make the interval closed with respect to the given frequency to
121121
the 'left', 'right', or both sides (None)
122+
name : object
123+
Name to be stored in the index
122124
"""
123125
_join_precedence = 10
124126

pandas/tseries/tests/test_timeseries.py

+5
Original file line numberDiff line numberDiff line change
@@ -1966,6 +1966,11 @@ def test_constructor_coverage(self):
19661966
end='2011-01-01', freq='B')
19671967
self.assertRaises(ValueError, DatetimeIndex, periods=10, freq='D')
19681968

1969+
def test_constructor_name(self):
1970+
idx = DatetimeIndex(start='2000-01-01', periods=1, freq='A',
1971+
name='TEST')
1972+
self.assertEquals(idx.name, 'TEST')
1973+
19691974
def test_comparisons_coverage(self):
19701975
rng = date_range('1/1/2000', periods=10)
19711976

0 commit comments

Comments
 (0)