-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Milestone
Description
Follow up on #776
In [1]: import numpy as np
In [2]: import dask.array as da
In [3]: x = np.array([[1.0, np.nan], [np.nan, 2.0]])
In [4]: da.nanmax(da.from_array(x, chunks=1), axis=1).compute()
/Users/shoyer/miniconda/envs/dask-dev/lib/python2.7/site-packages/numpy/lib/nanfunctions.py:319: RuntimeWarning: All-NaN slice encountered
warnings.warn("All-NaN slice encountered", RuntimeWarning)
Out[4]: array([ 1., 2.])
In [5]: da.nanargmax(da.from_array(x, chunks=1), axis=1).compute()
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-5-403b812e207c> in <module>()
----> 1 da.nanargmax(da.from_array(x, chunks=1), axis=1).compute()
/Users/shoyer/dev/dask/dask/base.pyc in compute(self, **kwargs)
29
30 def compute(self, **kwargs):
---> 31 return compute(self, **kwargs)[0]
32
33 @classmethod
/Users/shoyer/dev/dask/dask/base.pyc in compute(*args, **kwargs)
97 for opt, val in groups.items()])
98 keys = [arg._keys() for arg in args]
---> 99 results = get(dsk, keys, **kwargs)
100 return tuple(a._finalize(a, r) for a, r in zip(args, results))
101
/Users/shoyer/dev/dask/dask/threaded.pyc in get(dsk, result, cache, num_workers, **kwargs)
55 results = get_async(pool.apply_async, len(pool._pool), dsk, result,
56 cache=cache, queue=queue, get_id=_thread_get_id,
---> 57 **kwargs)
58
59 return results
/Users/shoyer/dev/dask/dask/async.pyc in get_async(apply_async, num_workers, dsk, result, cache, queue, get_id, raise_on_exception, rerun_exceptions_locally, callbacks, **kwargs)
480 _execute_task(task, data) # Re-execute locally
481 else:
--> 482 raise(remote_exception(res, tb))
483 state['cache'][key] = res
484 finish_task(dsk, key, state, results, keyorder.get)
ValueError: All-NaN slice encountered
Traceback
---------
File "dask/async.py", line 262, in execute_task
result = _execute_task(task, data)
File "dask/async.py", line 245, in _execute_task
return func(*args2)
File "dask/array/reductions.py", line 367, in argreduce
return (func(x, axis=axis), argfunc(x, axis=axis))
File "dask/array/chunk.py", line 25, in keepdims_wrapped_callable
r = a_callable(x, axis=axis, *args, **kwargs)
File "/Users/shoyer/miniconda/envs/dask-dev/lib/python2.7/site-packages/numpy/lib/nanfunctions.py", line 420, in nanargmax
raise ValueError("All-NaN slice encountered")
Metadata
Metadata
Assignees
Labels
No labels