From 6816dd8130dce4f4fa893606dfb8c662b082b5b2 Mon Sep 17 00:00:00 2001 From: TomAugspurger Date: Tue, 17 Dec 2013 10:17:18 -0600 Subject: [PATCH] DOC: DatetimeIndex accepts name param --- pandas/tseries/index.py | 2 ++ pandas/tseries/tests/test_timeseries.py | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/pandas/tseries/index.py b/pandas/tseries/index.py index fd9fac58a973c..23b949c1fedfb 100644 --- a/pandas/tseries/index.py +++ b/pandas/tseries/index.py @@ -119,6 +119,8 @@ class DatetimeIndex(Int64Index): closed : string or None, default None Make the interval closed with respect to the given frequency to the 'left', 'right', or both sides (None) + name : object + Name to be stored in the index """ _join_precedence = 10 diff --git a/pandas/tseries/tests/test_timeseries.py b/pandas/tseries/tests/test_timeseries.py index f2f137e18a15c..f4dcdb7a44a3e 100644 --- a/pandas/tseries/tests/test_timeseries.py +++ b/pandas/tseries/tests/test_timeseries.py @@ -1966,6 +1966,11 @@ def test_constructor_coverage(self): end='2011-01-01', freq='B') self.assertRaises(ValueError, DatetimeIndex, periods=10, freq='D') + def test_constructor_name(self): + idx = DatetimeIndex(start='2000-01-01', periods=1, freq='A', + name='TEST') + self.assertEquals(idx.name, 'TEST') + def test_comparisons_coverage(self): rng = date_range('1/1/2000', periods=10)