File tree 3 files changed +17
-3
lines changed
3 files changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -50,6 +50,7 @@ pandas 0.11.1
50
50
- support datelike columns with a timezone as data_columns (GH2852 _)
51
51
- table writing performance improvements.
52
52
- Add modulo operator to Series, DataFrame
53
+ - Add ``date `` method to DatetimeIndex
53
54
54
55
**API Changes **
55
56
@@ -287,7 +288,7 @@ pandas 0.11.0
287
288
on rhs (GH3216 _)
288
289
- Treat boolean values as integers (values 1 and 0) for numeric
289
290
operations. (GH2641 _)
290
- - Add ``time() `` method to DatetimeIndex (GH3180 _)
291
+ - Add ``time `` method to DatetimeIndex (GH3180 _)
291
292
- Return NA when using Series.str[...] for values that are not long enough
292
293
(GH3223 _)
293
294
- Display cursor coordinate information in time-series plots (GH1670 _)
Original file line number Diff line number Diff line change @@ -1319,11 +1319,18 @@ def freqstr(self):
1319
1319
@property
1320
1320
def time (self ):
1321
1321
"""
1322
- Returns array of datetime.time. The time of the day
1322
+ Returns numpy array of datetime.time. The time part of the Timestamps.
1323
1323
"""
1324
1324
# can't call self.map() which tries to treat func as ufunc
1325
1325
# and causes recursion warnings on python 2.6
1326
- return _algos .arrmap_object (self .asobject , lambda x :x .time ())
1326
+ return _algos .arrmap_object (self .asobject , lambda x : x .time ())
1327
+
1328
+ @property
1329
+ def date (self ):
1330
+ """
1331
+ Returns numpy array of datetime.date. The date part of the Timestamps.
1332
+ """
1333
+ return _algos .arrmap_object (self .asobject , lambda x : x .date ())
1327
1334
1328
1335
1329
1336
def normalize (self ):
Original file line number Diff line number Diff line change @@ -1847,6 +1847,12 @@ def test_time(self):
1847
1847
expected = [t .time () for t in rng ]
1848
1848
self .assert_ ((result == expected ).all ())
1849
1849
1850
+ def test_date (self ):
1851
+ rng = pd .date_range ('1/1/2000' , freq = '12H' , periods = 10 )
1852
+ result = pd .Index (rng ).date
1853
+ expected = [t .date () for t in rng ]
1854
+ self .assert_ ((result == expected ).all ())
1855
+
1850
1856
1851
1857
class TestLegacySupport (unittest .TestCase ):
1852
1858
_multiprocess_can_split_ = True
You can’t perform that action at this time.
0 commit comments