Skip to content

Commit 5c40359

Browse files
committed
MAINT: Remove combineAdd and combineMult
Deprecated in 0.17.0. xref gh-10735
1 parent d2f32a0 commit 5c40359

File tree

4 files changed

+23
-146
lines changed

4 files changed

+23
-146
lines changed

doc/source/10min.rst

+21-22
Original file line numberDiff line numberDiff line change
@@ -84,29 +84,28 @@ will be completed:
8484

8585
@verbatim
8686
In [1]: df2.<TAB>
87-
df2.A df2.boxplot
88-
df2.abs df2.C
89-
df2.add df2.clip
90-
df2.add_prefix df2.clip_lower
91-
df2.add_suffix df2.clip_upper
92-
df2.align df2.columns
93-
df2.all df2.combine
94-
df2.any df2.combineAdd
87+
df2.A df2.bool
88+
df2.abs df2.boxplot
89+
df2.add df2.C
90+
df2.add_prefix df2.clip
91+
df2.add_suffix df2.clip_lower
92+
df2.align df2.clip_upper
93+
df2.all df2.columns
94+
df2.any df2.combine
9595
df2.append df2.combine_first
96-
df2.apply df2.combineMult
97-
df2.applymap df2.compound
98-
df2.as_blocks df2.consolidate
99-
df2.asfreq df2.convert_objects
100-
df2.as_matrix df2.copy
101-
df2.astype df2.corr
102-
df2.at df2.corrwith
103-
df2.at_time df2.count
104-
df2.axes df2.cov
105-
df2.B df2.cummax
106-
df2.between_time df2.cummin
107-
df2.bfill df2.cumprod
108-
df2.blocks df2.cumsum
109-
df2.bool df2.D
96+
df2.apply df2.compound
97+
df2.applymap df2.consolidate
98+
df2.as_blocks df2.convert_objects
99+
df2.asfreq df2.copy
100+
df2.as_matrix df2.corr
101+
df2.astype df2.corrwith
102+
df2.at df2.count
103+
df2.at_time df2.cov
104+
df2.axes df2.cummax
105+
df2.B df2.cummin
106+
df2.between_time df2.cumprod
107+
df2.bfill df2.cumsum
108+
df2.blocks df2.D
110109

111110
As you can see, the columns ``A``, ``B``, ``C``, and ``D`` are automatically
112111
tab completed. ``E`` is there as well; the rest of the attributes have been

doc/source/whatsnew/v0.20.0.txt

+2
Original file line numberDiff line numberDiff line change
@@ -814,6 +814,8 @@ Removal of prior version deprecations/changes
814814
- The ``take_last`` parameter has been dropped from ``duplicated()``, ``drop_duplicates()``, ``nlargest()``, and ``nsmallest()`` methods (:issue:`10236`, :issue:`10792`, :issue:`10920`)
815815
- ``Series``, ``Index``, and ``DataFrame`` have dropped the ``sort`` and ``order`` methods (:issue:`10726`)
816816
- Where clauses in ``pytables`` are only accepted as strings and expressions types and not other data-types (:issue:`12027`)
817+
- ``DataFrame`` has dropped the ``combineAdd`` and ``combineMult`` methods in favor of ``add`` and ``mul`` respectively (:issue:`10735`)
818+
- ``Series``, ``Index``, and ``DataFrame`` have dropped the ``convert_objects`` method (:issue:`11173`)
817819

818820
.. _whatsnew_0200.performance:
819821

pandas/core/frame.py

-56
Original file line numberDiff line numberDiff line change
@@ -5362,62 +5362,6 @@ def isin(self, values):
53625362
values).reshape(self.shape), self.index,
53635363
self.columns)
53645364

5365-
# ----------------------------------------------------------------------
5366-
# Deprecated stuff
5367-
5368-
def combineAdd(self, other):
5369-
"""
5370-
DEPRECATED. Use ``DataFrame.add(other, fill_value=0.)`` instead.
5371-
5372-
Add two DataFrame objects and do not propagate
5373-
NaN values, so if for a (column, time) one frame is missing a
5374-
value, it will default to the other frame's value (which might
5375-
be NaN as well)
5376-
5377-
Parameters
5378-
----------
5379-
other : DataFrame
5380-
5381-
Returns
5382-
-------
5383-
DataFrame
5384-
5385-
See also
5386-
--------
5387-
DataFrame.add
5388-
5389-
"""
5390-
warnings.warn("'combineAdd' is deprecated. Use "
5391-
"'DataFrame.add(other, fill_value=0.)' instead",
5392-
FutureWarning, stacklevel=2)
5393-
return self.add(other, fill_value=0.)
5394-
5395-
def combineMult(self, other):
5396-
"""
5397-
DEPRECATED. Use ``DataFrame.mul(other, fill_value=1.)`` instead.
5398-
5399-
Multiply two DataFrame objects and do not propagate NaN values, so if
5400-
for a (column, time) one frame is missing a value, it will default to
5401-
the other frame's value (which might be NaN as well)
5402-
5403-
Parameters
5404-
----------
5405-
other : DataFrame
5406-
5407-
Returns
5408-
-------
5409-
DataFrame
5410-
5411-
See also
5412-
--------
5413-
DataFrame.mul
5414-
5415-
"""
5416-
warnings.warn("'combineMult' is deprecated. Use "
5417-
"'DataFrame.mul(other, fill_value=1.)' instead",
5418-
FutureWarning, stacklevel=2)
5419-
return self.mul(other, fill_value=1.)
5420-
54215365

54225366
DataFrame._setup_axes(['index', 'columns'], info_axis=1, stat_axis=0,
54235367
axes_are_reversed=True, aliases={'rows': 0})

pandas/tests/frame/test_operators.py

-68
Original file line numberDiff line numberDiff line change
@@ -1038,74 +1038,6 @@ def test_boolean_comparison(self):
10381038
self.assertRaises(ValueError, lambda: df == (2, 2))
10391039
self.assertRaises(ValueError, lambda: df == [2, 2])
10401040

1041-
def test_combineAdd(self):
1042-
1043-
with tm.assert_produces_warning(FutureWarning):
1044-
# trivial
1045-
comb = self.frame.combineAdd(self.frame)
1046-
assert_frame_equal(comb, self.frame * 2)
1047-
1048-
# more rigorous
1049-
a = DataFrame([[1., nan, nan, 2., nan]],
1050-
columns=np.arange(5))
1051-
b = DataFrame([[2., 3., nan, 2., 6., nan]],
1052-
columns=np.arange(6))
1053-
expected = DataFrame([[3., 3., nan, 4., 6., nan]],
1054-
columns=np.arange(6))
1055-
1056-
with tm.assert_produces_warning(FutureWarning):
1057-
result = a.combineAdd(b)
1058-
assert_frame_equal(result, expected)
1059-
1060-
with tm.assert_produces_warning(FutureWarning):
1061-
result2 = a.T.combineAdd(b.T)
1062-
assert_frame_equal(result2, expected.T)
1063-
1064-
expected2 = a.combine(b, operator.add, fill_value=0.)
1065-
assert_frame_equal(expected, expected2)
1066-
1067-
# corner cases
1068-
with tm.assert_produces_warning(FutureWarning):
1069-
comb = self.frame.combineAdd(self.empty)
1070-
assert_frame_equal(comb, self.frame)
1071-
1072-
with tm.assert_produces_warning(FutureWarning):
1073-
comb = self.empty.combineAdd(self.frame)
1074-
assert_frame_equal(comb, self.frame)
1075-
1076-
# integer corner case
1077-
df1 = DataFrame({'x': [5]})
1078-
df2 = DataFrame({'x': [1]})
1079-
df3 = DataFrame({'x': [6]})
1080-
1081-
with tm.assert_produces_warning(FutureWarning):
1082-
comb = df1.combineAdd(df2)
1083-
assert_frame_equal(comb, df3)
1084-
1085-
# mixed type GH2191
1086-
df1 = DataFrame({'A': [1, 2], 'B': [3, 4]})
1087-
df2 = DataFrame({'A': [1, 2], 'C': [5, 6]})
1088-
with tm.assert_produces_warning(FutureWarning):
1089-
rs = df1.combineAdd(df2)
1090-
xp = DataFrame({'A': [2, 4], 'B': [3, 4.], 'C': [5, 6.]})
1091-
assert_frame_equal(xp, rs)
1092-
1093-
# TODO: test integer fill corner?
1094-
1095-
def test_combineMult(self):
1096-
with tm.assert_produces_warning(FutureWarning):
1097-
# trivial
1098-
comb = self.frame.combineMult(self.frame)
1099-
1100-
assert_frame_equal(comb, self.frame ** 2)
1101-
1102-
# corner cases
1103-
comb = self.frame.combineMult(self.empty)
1104-
assert_frame_equal(comb, self.frame)
1105-
1106-
comb = self.empty.combineMult(self.frame)
1107-
assert_frame_equal(comb, self.frame)
1108-
11091041
def test_combine_generic(self):
11101042
df1 = self.frame
11111043
df2 = self.frame.loc[self.frame.index[:-5], ['A', 'B', 'C']]

0 commit comments

Comments
 (0)