readwrite.py 文件源码

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

项目:scanpy 作者: theislab 项目源码 文件源码
def preprocess_writing(key, value):
    if isinstance(value, dict):
        # hack for storing dicts
        value = np.array([str(value)])
    else:
        value = np.array(value)
        if value.ndim == 0:
            value = np.array([value])
    # some output about the data to write
    logg.m(key, type(value),
           value.dtype, value.dtype.kind, value.shape,
           v=6)
    # make sure string format is chosen correctly
    if value.dtype.kind == 'U':
        value = value.astype(np.string_)
    return key, value
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号