bark.py 文件源码

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

项目:bark 作者: kylerbrown 项目源码 文件源码
def read_sampled(datfile, mode="r"):
    """Loads raw binary file and associated metadata into a sampled dataset.

    Args:
        datfile (str): path to raw binary file to read from
        mode: may be "r" or "r+"; use "r+" for modifying the data
            (not recommended)

    Returns:
        SampledData: sampled dataset containing `datfile`'s data
    """
    path = os.path.abspath(datfile)
    params = read_metadata(datfile)
    try:
        data = np.memmap(datfile, dtype=params["dtype"], mode=mode)
    except ValueError:
        data = np.array([])
    data = data.reshape(-1, len(params['columns']))
    return SampledData(data, path, params)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号