nums.core.array.application module

class nums.core.array.application.ArrayApplication(cm, fs)[source]

Bases: object

abs(X)[source]
allclose(a, b, rtol=1e-05, atol=1e-08)[source]
arange(start_in, shape, block_shape, step=1, dtype=None)[source]
Return type

BlockArray

argop(op_name, arr, axis=None)[source]
array(array, block_shape=None)[source]
array_compare(func_name, a, b, *args)[source]
array_equal(a, b)[source]
array_equiv(a, b)[source]
atleast_1d(*arys)[source]
atleast_2d(*arys)[source]
atleast_3d(*arys)[source]
column_stack(tup, axis_block_size=None)[source]
compute_block_shape(shape, dtype, cluster_shape=None, num_cores=None)[source]
concatenate(arrays, axis, axis_block_size=None)[source]
cov(X, rowvar=True, bias=False, dtype=None)[source]
delete_fs(filename)[source]
Return type

bool

delete_s3(filename)[source]
Return type

bool

diag(X)[source]
Return type

BlockArray

dstack(tup, axis_block_size=None)[source]
empty(shape, block_shape, dtype=None)[source]
exp(X)[source]
eye(shape, block_shape, dtype=None)[source]
get(*arrs)[source]
get_block_shape(shape, dtype)[source]
hstack(tup, axis_block_size=None)[source]
isnan(X)[source]
linspace(start, stop, shape, block_shape, endpoint, retstep, dtype, axis)[source]
loadtxt(fname, dtype=<class 'float'>, comments='# ', delimiter=' ', converters=None, skiprows=0, usecols=None, unpack=False, ndmin=0, encoding='bytes', max_rows=None, num_workers=None)[source]
Return type

BlockArray

log(X)[source]
map_bop(op_name, arr_1, arr_2, out=None, where=True, args=None, kwargs=None)[source]

A map for binary operators that applies element-wise to every entry of the input arrays.

Parameters
  • op_name (str) – An element-wise binary operator.

  • arr_1 (BlockArray) – A BlockArray.

  • arr_2 (BlockArray) – A BlockArray.

  • out (Optional[BlockArray]) – A BlockArray to which the result is written.

  • where – An indicator specifying the indices to which op is applied.

  • args – Args provided to op.

  • kwargs – Keyword args provided to op.

Return type

BlockArray

Returns

A BlockArray.

map_uop(op_name, arr, out=None, where=True, args=None, kwargs=None)[source]

A map, for unary operators, that applies to every entry of an array.

Parameters
  • op_name (str) – An element-wise unary operator.

  • arr (BlockArray) – A BlockArray.

  • out (Optional[BlockArray]) – A BlockArray to which the result is written.

  • where – An indicator specifying the indices to which op is applied.

  • args – Args provided to op.

  • kwargs – Keyword args provided to op.

Return type

BlockArray

Returns

A BlockArray.

matmul(arr_1, arr_2)[source]
Return type

BlockArray

max(X, axis=None, keepdims=False)[source]
mean(X, axis=None, keepdims=False, dtype=None)[source]
median(arr)[source]

Compute the median of a BlockArray.

Parameters

a – A BlockArray.

Return type

BlockArray

Returns

The median value.

min(X, axis=None, keepdims=False)[source]
nanmean(a, axis=None, keepdims=False, dtype=None)[source]
nanstd(a, axis=None, ddof=0, keepdims=False, dtype=None)[source]
nanvar(a, axis=None, ddof=0, keepdims=False, dtype=None)[source]
norm(X, order=2)[source]
Return type

BlockArray

ones(shape, block_shape, dtype=None)[source]
percentile(arr, q, interpolation='linear', method='tdigest')[source]

Compute the q-th percentile of the array elements. :type arr: BlockArray :param arr: BlockArray. :type q: float :param q: Percentile to compute, which must be between 0 and 100 inclusive. :type interpolation: str :param interpolation: interpolation method to use when the desired percentile lies between two :param data points i < j.: :param also see https: //numpy.org/doc/1.20/reference/generated/numpy.percentile.html.

Return type

BlockArray

Returns

Returns the q-th percentile of the array elements.

quantile(arr, q, interpolation='linear', method='tdigest')[source]

Compute the q-th quantile of the array elements. :type arr: BlockArray :param arr: BlockArray. :type q: float :param q: quantile to compute, which must be between 0 and 1 inclusive. :param interpolation: interpolation method to use when the desired quantile lies between two :param data points i < j.: :param also see https: //numpy.org/doc/1.20/reference/generated/numpy.quantile.html. :param also see https: //docs.dask.org/en/latest/_modules/dask/array/percentile.html.

Return type

BlockArray

Returns

Returns the q-th quantile of the array elements.

random_state(seed=None)[source]
read_csv(filename, dtype=<class 'float'>, delimiter=', ', has_header=False, num_workers=None)[source]
read_fs(filename)[source]
Return type

BlockArray

read_s3(filename)[source]
reduce(op_name, X, axis=None, keepdims=False, dtype=None)[source]
row_stack(tup, axis_block_size=None)[source]
scalar(value)[source]
sqrt(X)[source]
Return type

BlockArray

std(X, axis=None, ddof=0, keepdims=False, dtype=None)[source]
sum(X, axis=None, keepdims=False, dtype=None)[source]
tensordot(arr_1, arr_2, axes=2)[source]
Return type

BlockArray

top_k(arr, k, largest=True)[source]

Find the k largest or smallest elements of a BlockArray.

If there are multiple kth elements that are equal in value, then no guarantees are made as to which ones are included in the top k.

Parameters
  • arr (BlockArray) – A BlockArray.

  • k (int) – Number of top elements to return.

  • largest – Whether to return largest or smallest elements.

Return type

Tuple[BlockArray, BlockArray]

Returns

A tuple containing two BlockArrays, (values, indices). values: Values of the top k elements, unsorted. indices: Indices of the top k elements, ordered by their corresponding values.

var(X, axis=None, ddof=0, keepdims=False, dtype=None)[source]
vec_from_oids(oids, shape, block_shape, dtype)[source]
vstack(tup, axis_block_size=None)[source]
where(condition, x=None, y=None)[source]
write_fs(ba, filename)[source]
Return type

BlockArray

write_s3(ba, filename)[source]
xlogy(x, y)[source]
Return type

BlockArray

zeros(shape, block_shape, dtype=None)[source]