Skip to content

Commit

Permalink
TST: Series Division with zeros numpy array (pandas-dev#8674) (pandas…
Browse files Browse the repository at this point in the history
  • Loading branch information
mroeschke authored and jorisvandenbossche committed Dec 30, 2016
1 parent 0d3ecfa commit d2a4b33
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions pandas/tests/series/test_operators.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,19 @@ def test_div(self):
expected = Series([-inf, nan, inf])
assert_series_equal(result, expected)

# GH 8674
zero_array = np.array([0] * 5)
data = np.random.randn(5)
expected = pd.Series([0.] * 5)
result = zero_array / pd.Series(data)
assert_series_equal(result, expected)

result = pd.Series(zero_array) / data
assert_series_equal(result, expected)

result = pd.Series(zero_array) / pd.Series(data)
assert_series_equal(result, expected)

def test_operators(self):
def _check_op(series, other, op, pos_only=False,
check_dtype=True):
Expand Down

0 comments on commit d2a4b33

Please sign in to comment.