Skip to content

Commit

Permalink
Update scipy/stats/_distn_infrastructure.py
Browse files Browse the repository at this point in the history
Co-authored-by: Pamphile ROY <[email protected]>
  • Loading branch information
2 people authored and rgommers committed Feb 28, 2021
1 parent 2233802 commit fdbe641
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions scipy/stats/_distn_infrastructure.py
Original file line number Diff line number Diff line change
Expand Up @@ -564,12 +564,9 @@ def argsreduce(cond, *args):
s = cond.shape
# np.extract returns flattened arrays, which are not broadcastable together unless they
# are either the same size or size == 1.
ret = []
for arg in newargs:
if np.size(arg) == 1:
ret.append(arg)
else:
ret.append(np.extract(cond, np.broadcast_to(arg, s)))
ret = [(arg if np.size(arg) == 1
else np.extract(cond, np.broadcast_to(arg, s)))
for arg in newargs]
return ret

parse_arg_template = """
Expand Down

0 comments on commit fdbe641

Please sign in to comment.