File tree Expand file tree Collapse file tree 4 files changed +14
-4
lines changed Expand file tree Collapse file tree 4 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -74,6 +74,7 @@ Improvements to existing features
74
74
the func (:issue: `6289 `)
75
75
- ``plot(legend='reverse') `` will now reverse the order of legend labels for most plot kinds.
76
76
(:issue: `6014 `)
77
+ - improve performance of slice indexing on Series with string keys (:issue: `6341 `)
77
78
78
79
.. _release.bug_fixes-0.14.0 :
79
80
Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ Enhancements
46
46
and parse accordingly. (:issue:`6223`)
47
47
- ``plot(legend='reverse')`` will now reverse the order of legend labels for
48
48
most plot kinds. (:issue:`6014`)
49
-
49
+ - improve performance of slice indexing on Series with string keys (:issue:`6341`)
50
50
51
51
Performance
52
52
~~~~~~~~~~~
Original file line number Diff line number Diff line change 9
9
import pandas .lib as lib
10
10
import pandas .algos as _algos
11
11
import pandas .index as _index
12
- from pandas .lib import Timestamp
12
+ from pandas .lib import Timestamp , is_datetime_array
13
13
from pandas .core .base import FrozenList , FrozenNDArray
14
14
15
15
from pandas .util .decorators import cache_readonly , deprecate
@@ -577,7 +577,7 @@ def is_type_compatible(self, typ):
577
577
578
578
@cache_readonly
579
579
def is_all_dates (self ):
580
- return self .inferred_type == 'datetime'
580
+ return is_datetime_array ( self .values )
581
581
582
582
def __iter__ (self ):
583
583
return iter (self .values )
Original file line number Diff line number Diff line change 7
7
"""
8
8
9
9
#----------------------------------------------------------------------
10
- # Series.__getitem__, get_value
10
+ # Series.__getitem__, get_value, __getitem__(slice)
11
11
12
12
setup = common_setup + """
13
13
tm.N = 1000
29
29
name = 'series_get_value' ,
30
30
start_date = datetime (2011 , 11 , 12 ))
31
31
32
+
33
+ setup = common_setup + """
34
+ index = tm.makeStringIndex(1000000)
35
+ s = Series(np.random.rand(1000000), index=index)
36
+ """
37
+ series_getitem_slice = Benchmark ("s[:800000]" , setup ,
38
+ name = "series_getitem_slice" )
39
+
40
+
32
41
#----------------------------------------------------------------------
33
42
# DataFrame __getitem__
34
43
You can’t perform that action at this time.
0 commit comments