diff options
author | Travis Oliphant <oliphant@enthought.com> | 2006-01-29 08:40:39 +0000 |
---|---|---|
committer | Travis Oliphant <oliphant@enthought.com> | 2006-01-29 08:40:39 +0000 |
commit | 2438f98798fa6cf0443433d879365cd2121b6b5e (patch) | |
tree | 3e7305a14290e7df9aea8cb666df01b83463a0ef /numpy/lib/function_base.py | |
parent | c0d68f47a04c22d1e9de64b8d09d43fb1b72fc63 (diff) | |
download | numpy-2438f98798fa6cf0443433d879365cd2121b6b5e.tar.gz |
Convert to arrays in piecewise. Improve error-handling of object-array conversions.
Diffstat (limited to 'numpy/lib/function_base.py')
-rw-r--r-- | numpy/lib/function_base.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/numpy/lib/function_base.py b/numpy/lib/function_base.py index 7f87818b1..cee17b0aa 100644 --- a/numpy/lib/function_base.py +++ b/numpy/lib/function_base.py @@ -14,7 +14,7 @@ import types import math import numpy.core.numeric as _nx from numpy.core.numeric import ones, zeros, arange, concatenate, array, \ - asarray, empty, empty_like + asarray, empty, empty_like, asanyarray from numpy.core.numeric import ScalarType, dot, where, newaxis, isscalar from numpy.core.umath import pi, multiply, add, arctan2, maximum, minimum, \ frompyfunc, isnan, absolute, cos, less_equal, sqrt, sin, mod, exp @@ -202,6 +202,7 @@ def piecewise(x, condlist, funclist, *args, **kw): |-- """ + x = asanyarray(x) n2 = len(funclist) if not isinstance(condlist, type([])): condlist = [condlist] |