Skip to content

Commit 32e60d7

Browse files
Merge pull request pandas-dev#10867 from jorisvandenbossche/iterkv
DEPR: iterkv change Deprecation to FutureWarning
2 parents fa2378b + efe56d1 commit 32e60d7

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

pandas/core/generic.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -701,7 +701,7 @@ def iterkv(self, *args, **kwargs):
701701
"iteritems alias used to get around 2to3. Deprecated"
702702
warnings.warn("iterkv is deprecated and will be removed in a future "
703703
"release, use ``iteritems`` instead.",
704-
DeprecationWarning)
704+
FutureWarning)
705705
return self.iteritems(*args, **kwargs)
706706

707707
def __len__(self):
@@ -2004,13 +2004,13 @@ def sample(self, n=None, frac=None, replace=False, weights=None, random_state=No
20042004
Sample with or without replacement. Default = False.
20052005
weights : str or ndarray-like, optional
20062006
Default 'None' results in equal probability weighting.
2007-
If passed a Series, will align with target object on index. Index
2007+
If passed a Series, will align with target object on index. Index
20082008
values in weights not found in sampled object will be ignored and
2009-
index values in sampled object not in weights will be assigned
2010-
weights of zero.
2009+
index values in sampled object not in weights will be assigned
2010+
weights of zero.
20112011
If called on a DataFrame, will accept the name of a column
20122012
when axis = 0.
2013-
Unless weights are a Series, weights must be same length as axis
2013+
Unless weights are a Series, weights must be same length as axis
20142014
being sampled.
20152015
If weights do not sum to 1, they will be normalized to sum to 1.
20162016
Missing values in the weights column will be treated as zero.
@@ -2040,8 +2040,8 @@ def sample(self, n=None, frac=None, replace=False, weights=None, random_state=No
20402040
if weights is not None:
20412041

20422042
# If a series, align with frame
2043-
if isinstance(weights, pd.Series):
2044-
weights = weights.reindex(self.axes[axis])
2043+
if isinstance(weights, pd.Series):
2044+
weights = weights.reindex(self.axes[axis])
20452045

20462046
# Strings acceptable if a dataframe and axis = 0
20472047
if isinstance(weights, string_types):

pandas/tests/test_frame.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -14188,7 +14188,7 @@ def test_take(self):
1418814188
assert_frame_equal(result, expected)
1418914189

1419014190
def test_iterkv_deprecation(self):
14191-
with tm.assert_produces_warning(DeprecationWarning):
14191+
with tm.assert_produces_warning(FutureWarning):
1419214192
self.mixed_float.iterkv()
1419314193

1419414194
def test_iterkv_names(self):

0 commit comments

Comments
 (0)