We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fb339f0 commit 5f3b3deCopy full SHA for 5f3b3de
python/pyspark/pandas/tests/computation/test_binary_ops.py
@@ -177,6 +177,19 @@ def test_divide_by_zero_behavior(self):
177
psdf = ps.from_pandas(pdf)
178
self.assert_eq(psdf["a"] / psdf["b"], pdf["a"] / pdf["b"])
179
180
+ pdf = pd.DataFrame(
181
+ {
182
+ "a": [1, -1, 0],
183
+ "b": [0, 0, 0],
184
+ }
185
+ )
186
+ psdf = ps.from_pandas(pdf)
187
+ # a / b: .. divide by zero
188
+ self.assert_eq(psdf["a"] / psdf["b"], pdf["a"] / pdf["b"])
189
+
190
+ # b / a: 0 divided by ..
191
+ self.assert_eq(psdf["b"] / psdf["a"], pdf["b"] / pdf["a"])
192
193
def test_binary_operator_truediv(self):
194
# Positive
195
pdf = pd.DataFrame({"a": [3], "b": [2]})
0 commit comments