File tree Expand file tree Collapse file tree 3 files changed +13
-3
lines changed Expand file tree Collapse file tree 3 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -128,7 +128,8 @@ Other Enhancements
128128- :func:`DataFrame.add_prefix` and :func:`DataFrame.add_suffix` now accept strings containing the '%' character. (:issue:`17151`)
129129- `read_*` methods can now infer compression from non-string paths, such as ``pathlib.Path`` objects (:issue:`17206`).
130130- :func:`pd.read_sas()` now recognizes much more of the most frequently used date (datetime) formats in SAS7BDAT files (:issue:`15871`).
131- - :func:`DataFrame.items` is now present in both Python 2 and 3 and is lazy in all cases (:issue:`13918`, :issue:`17213`)
131+ - :func:`DataFrame.items` and :func:`Series.items` is now present in both Python 2 and 3 and is lazy in all cases (:issue:`13918`, :issue:`17213`)
132+
132133
133134
134135
Original file line number Diff line number Diff line change @@ -1110,8 +1110,7 @@ def iteritems(self):
11101110 """
11111111 return zip (iter (self .index ), iter (self ))
11121112
1113- if compat .PY3 : # pragma: no cover
1114- items = iteritems
1113+ items = iteritems
11151114
11161115 # ----------------------------------------------------------------------
11171116 # Misc public methods
Original file line number Diff line number Diff line change @@ -301,6 +301,16 @@ def test_iteritems(self):
301301 # assert is lazy (genrators don't define reverse, lists do)
302302 assert not hasattr (self .series .iteritems (), 'reverse' )
303303
304+ def test_items (self ):
305+ for idx , val in self .series .items ():
306+ assert val == self .series [idx ]
307+
308+ for idx , val in self .ts .items ():
309+ assert val == self .ts [idx ]
310+
311+ # assert is lazy (genrators don't define reverse, lists do)
312+ assert not hasattr (self .series .items (), 'reverse' )
313+
304314 def test_raise_on_info (self ):
305315 s = Series (np .random .randn (10 ))
306316 with pytest .raises (AttributeError ):
You can’t perform that action at this time.
0 commit comments