コード例 #1
0
    def to_type_blocks(self) -> TypeBlocks:
        '''
        Provide a correctly typed TypeBlocks representation.
        '''
        depth_count = self.depth
        if depth_count == 0:
            return TypeBlocks.from_zero_size_shape()

        return TypeBlocks.from_blocks(
            self.values_at_depth(d) for d in range(depth_count))
コード例 #2
0
ファイル: index_level.py プロジェクト: admdev8/static-frame
    def to_type_blocks(self) -> TypeBlocks:
        '''
        Provide a correctly typed TypeBlocks representation.
        '''
        try:
            depth_count = self.depth
        except StopIteration:
            # assume we have no depth or length
            return TypeBlocks.from_zero_size_shape()

        return TypeBlocks.from_blocks(
            self.values_at_depth(d) for d in range(depth_count))