hdf5.py 文件源码

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

项目:cellranger 作者: 10XGenomics 项目源码 文件源码
def append_data_frame(fn, df):
    ''' Write the pandas dataframe object to an HDF5 file.  Each column is written as a single 1D dataset at the top
    level of the HDF5 file, using the native pandas datatype'''

    if not os.path.exists(fn):
        write_data_frame(fn, df)
        return

    f = h5py.File(fn, "a")

    column_names = f.attrs.get("column_names")

    for col_name in column_names:
        ds = f[col_name]
        col = df[col_name]
        append_data_column(ds, col)

    f.close()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号