File tree 3 files changed +13
-3
lines changed
3 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -128,7 +128,8 @@ Other Enhancements
128
128
- :func:`DataFrame.add_prefix` and :func:`DataFrame.add_suffix` now accept strings containing the '%' character. (:issue:`17151`)
129
129
- `read_*` methods can now infer compression from non-string paths, such as ``pathlib.Path`` objects (:issue:`17206`).
130
130
- :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:`Serise.items` is now present in both Python 2 and 3 and is lazy in all cases (:issue:`13918`, :issue:`17213`)
132
+
132
133
133
134
134
135
Original file line number Diff line number Diff line change @@ -1110,8 +1110,7 @@ def iteritems(self):
1110
1110
"""
1111
1111
return zip (iter (self .index ), iter (self ))
1112
1112
1113
- if compat .PY3 : # pragma: no cover
1114
- items = iteritems
1113
+ items = iteritems
1115
1114
1116
1115
# ----------------------------------------------------------------------
1117
1116
# Misc public methods
Original file line number Diff line number Diff line change @@ -301,6 +301,16 @@ def test_iteritems(self):
301
301
# assert is lazy (genrators don't define reverse, lists do)
302
302
assert not hasattr (self .series .iteritems (), 'reverse' )
303
303
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
+
304
314
def test_raise_on_info (self ):
305
315
s = Series (np .random .randn (10 ))
306
316
with pytest .raises (AttributeError ):
You can’t perform that action at this time.
0 commit comments