Fixed failures

master
Per A Brodtkorb 7 years ago
parent 6925c42a94
commit d3583b8e53

@ -215,7 +215,7 @@ def accum(accmap, a, func=None, shape=None, fill_value=0, dtype=None):
# Create the output array.
out = np.empty(shape, dtype=dtype)
for s in product(*[np.arange(k) for k in shape]):
for s in product(*[list(range(k)) for k in shape]):
if vals[s] == []:
out[s] = fill_value
else:
@ -249,7 +249,7 @@ def _gridcount_nd(acfun, data, x, y, w, binx):
c = np.reshape(c / w, c_shape, order='F')
T = np.arange(d).tolist()
T = list(range(d))
T[1], T[0] = T[0], T[1]
# make sure c is stored in the same way as meshgrid
c = c.transpose(*T)

@ -204,13 +204,15 @@ def piecewise(condlist, funclist, xi=None, fill_value=0.0, args=(), **kw):
if xi is None:
arrays = ()
dtype = np.result_type(*funclist)
shape = condlist[0].shape
else:
if not isinstance(xi, tuple):
xi = (xi,)
arrays = np.broadcast_arrays(*xi)
dtype = np.result_type(*arrays)
shape = arrays[0].shape
out = valarray(condlist[0].shape, fill_value, dtype)
out = valarray(shape, fill_value, dtype)
for cond, func in zip(condlist, funclist):
if cond.any():
if isinstance(func, collections.Callable):

Loading…
Cancel
Save