utils.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:motif 作者: rabitt 项目源码 文件源码
def get_snippet_idx(snippet, full_array):
    """ Find the indices of ``full_array`` where ``snippet`` is present.
    Assumes both ``snippet`` and ``full_array`` are ordered.

    Parameters
    ----------
    snippet : np.array
        Array of ordered time stamps
    full_array : np.array
        Array of ordered time stamps

    Returns
    -------
    idx : np.array
        Array of booleans indicating where in ``full_array`` ``snippet``
        is present.

    """
    idx = np.logical_and(
        full_array >= snippet[0], full_array <= snippet[-1]
    )
    return idx
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号