How to use the deepdish.io.ls.ObjectNode function in deepdish

To help you get started, we’ve selected a few deepdish examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github uchicago-cs / deepdish / deepdish / io / ls.py View on Github external
shape = _pandas_shape(level)
                new_node = PandasPanelNode(shape)
                return new_node
            # else: it will simply be treated as a dict

        elif level._v_title.startswith('sparse:') and not raw:
            frm = level._v_attrs.format
            dtype = level.data.dtype
            shape = tuple(level.shape[:])
            node = SparseMatrixNode(frm, shape, dtype)
            return node

        return node
    elif isinstance(level, tables.VLArray):
        if level.shape == (1,):
            return ObjectNode()
        node = NumpyArrayNode(level.shape, 'unknown')
        return node
    elif isinstance(level, tables.Array):
        stats = {}
        if settings.get('summarize'):
            stats['mean'] = level[:].mean()
            stats['std'] = level[:].std()

        compression = {}
        if settings.get('compression'):
            compression['complib'] = level.filters.complib
            compression['shuffle'] = level.filters.shuffle
            compression['complevel'] = level.filters.complevel

        node = NumpyArrayNode(level.shape, _format_dtype(level.dtype),
                              statistics=stats, compression=compression)