def from_func(func, shape, dtype=None, name=None, args=(), kwargs={}):
 name = (name or ('from_func-' + tokenize(func, shape, dtype, args, kwargs)))
 if (args or kwargs):
  func = partial(func, *args, **kwargs)
 dsk = {((name,) + ((0,) * len(shape))): (func,)}
 chunks = tuple(((i,) for i in shape))
 return Array(dsk, name, chunks, dtype)

def from_func ( func , shape , dtype = None , name = None , args = ( ) , kwargs = { } ) : name = ( name or ( 'from_func-' + tokenize ( func , shape , dtype , args , kwargs ) ) ) if ( args or kwargs ) : func = partial ( func , * args , ** kwargs ) dsk = { ( ( name , ) + ( ( 0 , ) * len ( shape ) ) ) : ( func , ) } chunks = tuple ( ( ( i , ) for i in shape ) ) return Array ( dsk , name , chunks , dtype )
create dask array in a single block by calling a function calling the provided function with func should return a numpy array of the indicated shape and dtype .