博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
np.concatenate 拼接
阅读量:7185 次
发布时间:2019-06-29

本文共 2295 字,大约阅读时间需要 7 分钟。

concatenate(...)
    concatenate((a1, a2, ...), axis=0, out=None)
    
    Join a sequence of arrays along an existing axis.
    
    Parameters
    ----------
    a1, a2, ... : sequence of array_like
        The arrays must have the same shape, except in the dimension
        corresponding to `axis` (the first, by default).
    axis : int, optional
        The axis along which the arrays will be joined.  Default is 0.
    out : ndarray, optional
        If provided, the destination to place the result. The shape must be
        correct, matching that of what concatenate would have returned if no
        out argument were specified.
    
    Returns
    -------
    res : ndarray
        The concatenated array.
    
    See Also
    --------
    ma.concatenate : Concatenate function that preserves input masks.
    array_split : Split an array into multiple sub-arrays of equal or
                  near-equal size.
    split : Split array into a list of multiple sub-arrays of equal size.
    hsplit : Split array into multiple sub-arrays horizontally (column wise)
    vsplit : Split array into multiple sub-arrays vertically (row wise)
    dsplit : Split array into multiple sub-arrays along the 3rd axis (depth).
    stack : Stack a sequence of arrays along a new axis.
    hstack : Stack arrays in sequence horizontally (column wise)
    vstack : Stack arrays in sequence vertically (row wise)
    dstack : Stack arrays in sequence depth wise (along third dimension)
    
    Notes
    -----
    When one or more of the arrays to be concatenated is a MaskedArray,
    this function will return a MaskedArray object instead of an ndarray,
    but the input masks are *not* preserved. In cases where a MaskedArray
    is expected as input, use the ma.concatenate function from the masked
    array module instead.
    
    Examples
    --------
    >>> a = np.array([[1, 2], [3, 4]])
    >>> b = np.array([[5, 6]])
    >>> np.concatenate((a, b), axis=0)
    array([[1, 2],
           [3, 4],
           [5, 6]])
    >>> np.concatenate((a, b.T), axis=1)
    array([[1, 2, 5],
           [3, 4, 6]])
    
    This function will not preserve masking of MaskedArray inputs.
    
    >>> a = np.ma.arange(3)
    >>> a[1] = np.ma.masked
    >>> b = np.arange(2, 5)
    >>> a
    masked_array(data = [0 -- 2],
                 mask = [False  True False],
           fill_value = 999999)
    >>> b
    array([2, 3, 4])
    >>> np.concatenate([a, b])
    masked_array(data = [0 1 2 2 3 4],
                 mask = False,
           fill_value = 999999)
    >>> np.ma.concatenate([a, b])
    masked_array(data = [0 -- 2 2 3 4],
                 mask = [False  True False False False False],
           fill_value = 999999)

转载地址:http://lmykm.baihongyu.com/

你可能感兴趣的文章
go filepath Abs
查看>>
透视JVM之垃圾回收
查看>>
【MySQL】replace into
查看>>
jxl 操作模板,自适应高度HssfCellStyle 自适应。
查看>>
从SharePoint当前状态看企业未来发展
查看>>
css02
查看>>
Hot Standby 与 Stream Replication
查看>>
【ZZ已解决】Python中如何在嵌套函数内部访问被嵌套(的父级函数)中的(局部,非全局)变量...
查看>>
一款jQuery满屏自适应焦点图切换特效
查看>>
python技能(2)-sys.argv
查看>>
NFS 安装问题解决
查看>>
对 Sea.js 进行配置 seajs.config
查看>>
我几次求职经验谈--智联相伴
查看>>
PHP中文乱码问题总结[转]
查看>>
IPv6系列-入门指南
查看>>
spring学习笔记(二)
查看>>
DNS智能解析的另类使用 让搜索引擎更快更好的收录您的网站
查看>>
转:java操作文件
查看>>
工具系列——eslint的使用
查看>>
思科IOS配置五大技巧
查看>>