Ejemplo n.º 1
0
    def _unpickle_sparse_frame_compat(self, state):
        """ original pickle format """
        series, cols, idx, fv, kind = state

        if not isinstance(cols, Index):  # pragma: no cover
            from pandas.io.pickle import _unpickle_array
            columns = _unpickle_array(cols)
        else:
            columns = cols

        if not isinstance(idx, Index):  # pragma: no cover
            from pandas.io.pickle import _unpickle_array
            index = _unpickle_array(idx)
        else:
            index = idx

        series_dict = DataFrame()
        for col, (sp_index, sp_values) in compat.iteritems(series):
            series_dict[col] = SparseSeries(sp_values,
                                            sparse_index=sp_index,
                                            fill_value=fv)

        self._data = to_manager(series_dict, columns, index)
        self._default_fill_value = fv
        self._default_kind = kind
Ejemplo n.º 2
0
    def _unpickle_sparse_frame_compat(self, state):
        """
        Original pickle format
        """
        series, cols, idx, fv, kind = state

        if not isinstance(cols, Index):  # pragma: no cover
            from pandas.io.pickle import _unpickle_array
            columns = _unpickle_array(cols)
        else:
            columns = cols

        if not isinstance(idx, Index):  # pragma: no cover
            from pandas.io.pickle import _unpickle_array
            index = _unpickle_array(idx)
        else:
            index = idx

        series_dict = DataFrame()
        for col, (sp_index, sp_values) in compat.iteritems(series):
            series_dict[col] = SparseSeries(sp_values, sparse_index=sp_index,
                                            fill_value=fv)

        self._data = to_manager(series_dict, columns, index)
        self._default_fill_value = fv
        self._default_kind = kind
Ejemplo n.º 3
0
    def __setstate__(self, state):
        frames, items, major, minor, fv, kind = state

        from pandas.io.pickle import _unpickle_array
        self.default_fill_value = fv
        self.default_kind = kind
        self._items = _ensure_index(_unpickle_array(items))
        self._major_axis = _ensure_index(_unpickle_array(major))
        self._minor_axis = _ensure_index(_unpickle_array(minor))
        self._frames = frames
Ejemplo n.º 4
0
    def __setstate__(self, state):
        frames, items, major, minor, fv, kind = state

        from pandas.io.pickle import _unpickle_array
        self.default_fill_value = fv
        self.default_kind = kind
        self._items = _ensure_index(_unpickle_array(items))
        self._major_axis = _ensure_index(_unpickle_array(major))
        self._minor_axis = _ensure_index(_unpickle_array(minor))
        self._frames = frames