Exemple #1
0
    def iget(self, i: int) -> SingleBlockManager:
        """
        Return the data as a SingleBlockManager.
        """
        from pandas.core.internals.managers import SingleBlockManager

        values = self.arrays[i]
        block = make_block(values, placement=slice(0, len(values)), ndim=1)

        return SingleBlockManager(block, self._axes[0])
Exemple #2
0
def pandas_series_resolver(obj, resolver):
    meta = obj.meta
    name = from_json(meta['name'])
    index = resolver.run(obj.member('index_'))
    np_value = resolver.run(obj.member('value_'))
    if BlockPlacement:
        placement = BlockPlacement(slice(0, len(np_value), 1))
    else:
        placement = slice(0, len(np_value), 1)
    block = Block(np_value, placement, ndim=1)
    return pd.Series(SingleBlockManager(block, index), name=name)