用法:
dask.array.overlap.overlap(x, depth, boundary)
在相邻块之间共享边界
- x: da.Array:
一个暗阵列
- depth: dict:
每个轴的共享边界的大小
- boundary: dict:
每个轴上的边界条件。选项是‘reflect’, ‘periodic’, ‘nearest’, ‘none’,或一个数组值。这样的值将用该值填充边界。
- The depth input informs how many cells to overlap between neighboring:
- blocks ``{0: 2, 2: 5}`` means share two cells in 0 axis, 5 cells in 2 axis.:
- Axes missing from this input will not be overlapped.:
- Any axis containing chunks smaller than depth will be rechunked if:
- possible.:
参数:
例子:
>>> import numpy as np >>> import dask.array as da
>>> x = np.arange(64).reshape((8, 8)) >>> d = da.from_array(x, chunks=(4, 4)) >>> d.chunks ((4, 4), (4, 4))
>>> g = da.overlap.overlap(d, depth={0: 2, 1: 1}, ... boundary={0: 100, 1: 'reflect'}) >>> g.chunks ((8, 8), (6, 6))
>>> np.array(g) array([[100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100], [100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100], [ 0, 0, 1, 2, 3, 4, 3, 4, 5, 6, 7, 7], [ 8, 8, 9, 10, 11, 12, 11, 12, 13, 14, 15, 15], [ 16, 16, 17, 18, 19, 20, 19, 20, 21, 22, 23, 23], [ 24, 24, 25, 26, 27, 28, 27, 28, 29, 30, 31, 31], [ 32, 32, 33, 34, 35, 36, 35, 36, 37, 38, 39, 39], [ 40, 40, 41, 42, 43, 44, 43, 44, 45, 46, 47, 47], [ 16, 16, 17, 18, 19, 20, 19, 20, 21, 22, 23, 23], [ 24, 24, 25, 26, 27, 28, 27, 28, 29, 30, 31, 31], [ 32, 32, 33, 34, 35, 36, 35, 36, 37, 38, 39, 39], [ 40, 40, 41, 42, 43, 44, 43, 44, 45, 46, 47, 47], [ 48, 48, 49, 50, 51, 52, 51, 52, 53, 54, 55, 55], [ 56, 56, 57, 58, 59, 60, 59, 60, 61, 62, 63, 63], [100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100], [100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100]])
相关用法
- Python dask.array.overlap.map_overlap用法及代码示例
- Python dask.array.outer用法及代码示例
- Python dask.array.ones用法及代码示例
- Python dask.array.stats.ttest_ind用法及代码示例
- Python dask.array.ma.masked_values用法及代码示例
- Python dask.array.divmod用法及代码示例
- Python dask.array.negative用法及代码示例
- Python dask.array.stats.ttest_rel用法及代码示例
- Python dask.array.ma.average用法及代码示例
- Python dask.array.vstack用法及代码示例
- Python dask.array.isneginf用法及代码示例
- Python dask.array.ma.masked_array用法及代码示例
- Python dask.array.matmul用法及代码示例
- Python dask.array.random.weibull用法及代码示例
- Python dask.array.Array.compute_chunk_sizes用法及代码示例
- Python dask.array.random.geometric用法及代码示例
- Python dask.array.around用法及代码示例
- Python dask.array.gradient用法及代码示例
- Python dask.array.coarsen用法及代码示例
- Python dask.array.fft.ifftshift用法及代码示例
注:本文由纯净天空筛选整理自dask.org大神的英文原创作品 dask.array.overlap.overlap。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。