Skip to content

Commit

Permalink
API: Drop DataFrame.iterkv()
Browse files Browse the repository at this point in the history
Deprecated since 0.17.0

xref pandas-dev#10711

Author: gfyoung <gfyoung17@gmail.com>

Closes pandas-dev#15650 from gfyoung/df-iterkv-remove and squashes the following commits:

e40fc9e [gfyoung] API: Drop DataFrame.iterkv()
  • Loading branch information
gfyoung authored and AnkurDedania committed Mar 21, 2017
1 parent e1996ce commit 482b28d
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 15 deletions.
1 change: 1 addition & 0 deletions doc/source/whatsnew/v0.20.0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -692,6 +692,7 @@ Other API Changes
- Reorganization of timeseries development tests (:issue:`14854`)
- Specific support for ``copy.copy()`` and ``copy.deepcopy()`` functions on NDFrame objects (:issue:`15444`)
- ``Series.sort_values()`` accepts a one element list of bool for consistency with the behavior of ``DataFrame.sort_values()`` (:issue:`15604`)
- ``DataFrame.iterkv()`` has been removed in favor of ``DataFrame.iteritems()`` (:issue:`10711`)

.. _whatsnew_0200.deprecations:

Expand Down
10 changes: 0 additions & 10 deletions pandas/core/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -899,16 +899,6 @@ def iteritems(self):
for h in self._info_axis:
yield h, self[h]

# originally used to get around 2to3's changes to iteritems.
# Now unnecessary. Sidenote: don't want to deprecate this for a while,
# otherwise libraries that use 2to3 will have issues.
def iterkv(self, *args, **kwargs):
"iteritems alias used to get around 2to3. Deprecated"
warnings.warn("iterkv is deprecated and will be removed in a future "
"release, use ``iteritems`` instead.", FutureWarning,
stacklevel=2)
return self.iteritems(*args, **kwargs)

def __len__(self):
"""Returns length of info axis"""
return len(self._info_axis)
Expand Down
6 changes: 1 addition & 5 deletions pandas/tests/frame/test_misc_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,11 +389,7 @@ def test_repr_with_mi_nat(self):
exp = ' X\nNaT a 1\n2013-01-01 b 2'
self.assertEqual(res, exp)

def test_iterkv_deprecation(self):
with tm.assert_produces_warning(FutureWarning):
self.mixed_float.iterkv()

def test_iterkv_names(self):
def test_iteritems_names(self):
for k, v in compat.iteritems(self.mixed_frame):
self.assertEqual(v.name, k)

Expand Down

0 comments on commit 482b28d

Please sign in to comment.