packages/vaex-core/vaex/dataframe.py
def byte_size(self, selection=False, virtual=False):
        """Return the size in bytes the whole DataFrame requires (or the selection), respecting the active_fraction."""
        bytes_per_row = 0
        N = self.count(selection=selection)
        extra = 0
        for column in list(self.get_column_names(virtual=virtual)):
            dtype = self.dtype(column)
            dtype_internal = self.dtype(column, internal=True)
            #if dtype in [str_type, str] and dtype_internal.kind == 'O':
            if isinstance(self.columns[column], ColumnString):
                # TODO: document or fix this
                # is it too expensive to calculate this exactly?
                extra += self.columns[column].nbytes
            else:
                bytes_per_row += dtype_internal.itemsize
                if np.ma.isMaskedArray(self.columns[column]):
                    bytes_per_row += 1
        return bytes_per_row * self.count(selection=selection) + extra
def byte_size(self, selection=False, virtual=False):
        """Return the size in bytes the whole DataFrame requires (or the selection), respecting the active_fraction."""
        bytes_per_row = 0
        N = self.count(selection=selection)
        extra = 0
        for column in list(self.get_column_names(virtual=virtual)):
            dtype = self.dtype(column)
            dtype_internal = self.dtype(column, internal=True)
            #if dtype in [str_type, str] and dtype_internal.kind == 'O':
            if isinstance(self.columns[column], ColumnString):
                # TODO: document or fix this
                # is it too expensive to calculate this exactly?
                extra += self.columns[column].nbytes
            else:
                bytes_per_row += dtype_internal.itemsize
                if np.ma.isMaskedArray(self.columns[column]):
                    bytes_per_row += 1
        return bytes_per_row * self.count(selection=selection) + extra
def byte_size ( self , selection = False , virtual = False ) : bytes_per_row = 0 N = self . count ( selection = selection ) extra = 0 for column in list ( self . get_column_names ( virtual = virtual ) ) : dtype = self . dtype ( column ) dtype_internal = self . dtype ( column , internal = True ) #if dtype in [str_type, str] and dtype_internal.kind == 'O': if isinstance ( self . columns [ column ] , ColumnString ) : # TODO: document or fix this # is it too expensive to calculate this exactly? extra += self . columns [ column ] . nbytes else : bytes_per_row += dtype_internal . itemsize if np . ma . isMaskedArray ( self . columns [ column ] ) : bytes_per_row += 1 return bytes_per_row * self . count ( selection = selection ) + extra
Return the size in bytes the whole DataFrame requires (or the selection), respecting the active_fraction.
Return the size in bytes the whole DataFrame requires ( or the selection ) respecting the active_fraction .