def to_dict(self, data=True):
        """Dictionary representation of variable."""
        item = {'dims': self.dims,
                'attrs': decode_numpy_dict_values(self.attrs)}
        if data:
            item['data'] = ensure_us_time_resolution(self.values).tolist()
        else:
            item.update({'dtype': str(self.dtype), 'shape': self.shape})
        return item
def to_dict ( self , data = True ) : item = { 'dims' : self . dims , 'attrs' : decode_numpy_dict_values ( self . attrs ) } if data : item [ 'data' ] = ensure_us_time_resolution ( self . values ) . tolist ( ) else : item . update ( { 'dtype' : str ( self . dtype ) , 'shape' : self . shape } ) return item
Dictionary representation of variable.