예제 #1
0
파일: frame.py 프로젝트: wudcwctw/pandas
def dict_to_manager(sdict, columns, index):
    """ create and return the block manager from a dict of series, columns, index """

    # from BlockManager perspective
    axes = [_ensure_index(columns), _ensure_index(index)]

    return create_block_manager_from_arrays([sdict[c] for c in columns], columns, axes)
예제 #2
0
파일: frame.py 프로젝트: amirneto/pandas
def dict_to_manager(sdict, columns, index):
    """ create and return the block manager from a dict of series, columns, index """

    # from BlockManager perspective
    axes = [_ensure_index(columns), _ensure_index(index)]

    return create_block_manager_from_arrays([sdict[c] for c in columns], columns, axes)
예제 #3
0
def arrays_to_mgr(arrays,
                  arr_names,
                  index,
                  columns,
                  dtype=None,
                  verify_integrity=True):
    """
    Segregate Series based on type and coerce into matrices.

    Needs to handle a lot of exceptional cases.
    """
    if verify_integrity:
        # figure out the index, if necessary
        if index is None:
            index = extract_index(arrays)
        else:
            index = ensure_index(index)

        # don't force copy because getting jammed in an ndarray anyway
        arrays = _homogenize(arrays, index, dtype)

        columns = ensure_index(columns)

    # from BlockManager perspective
    axes = [columns, index]

    return create_block_manager_from_arrays(arrays, arr_names, axes)
예제 #4
0
파일: frame.py 프로젝트: zyazxr/pandas
def to_manager(sdf, columns, index):
    """ create and return the block manager from a dataframe of series,
    columns, index
    """

    # from BlockManager perspective
    axes = [ensure_index(columns), ensure_index(index)]

    return create_block_manager_from_arrays([sdf[c] for c in columns], columns, axes)
예제 #5
0
파일: frame.py 프로젝트: sechilds/pandas
def to_manager(sdf, columns, index):
    """ create and return the block manager from a dataframe of series,
    columns, index
    """

    # from BlockManager perspective
    axes = [ensure_index(columns), ensure_index(index)]

    return create_block_manager_from_arrays(
        [sdf[c] for c in columns], columns, axes)
예제 #6
0
def arrays_to_mgr(arrays, arr_names, index, columns, dtype=None):
    """
    Segregate Series based on type and coerce into matrices.

    Needs to handle a lot of exceptional cases.
    """
    # figure out the index, if necessary
    if index is None:
        index = extract_index(arrays)
    else:
        index = ensure_index(index)

    # don't force copy because getting jammed in an ndarray anyway
    arrays = _homogenize(arrays, index, dtype)

    # from BlockManager perspective
    axes = [ensure_index(columns), index]

    return create_block_manager_from_arrays(arrays, arr_names, axes)
예제 #7
0
파일: panel.py 프로젝트: hiseba/pandas
 def _init_arrays(self, arrays, arr_names, axes):
     return create_block_manager_from_arrays(arrays, arr_names, axes)
예제 #8
0
 def _init_arrays(self, arrays, arr_names, axes):
     return create_block_manager_from_arrays(arrays, arr_names, axes)