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 gh-11121
  • Loading branch information
gfyoung committed Mar 10, 2017
1 parent 15e8e9a commit e40fc9e
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 14 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:`11121`)

.. _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
4 changes: 0 additions & 4 deletions pandas/tests/frame/test_misc_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,10 +389,6 @@ 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):
for k, v in compat.iteritems(self.mixed_frame):
self.assertEqual(v.name, k)
Expand Down

0 comments on commit e40fc9e

Please sign in to comment.