Beispiel #1
0
def _install():
    from pandas.util import cache_readonly
    from .iloc import iloc, head, tail
    from .loc import loc
    from .iat import iat
    from .at import at
    from .set_index import set_index
    from .getitem import dataframe_getitem, series_getitem
    from .setitem import dataframe_setitem
    from ..operands import DATAFRAME_TYPE, SERIES_TYPE

    for cls in DATAFRAME_TYPE + SERIES_TYPE:
        setattr(cls, 'iloc', cache_readonly(iloc))
        setattr(cls, 'loc', cache_readonly(loc))
        setattr(cls, 'iat', cache_readonly(iat))
        setattr(cls, 'at', cache_readonly(at))
        setattr(cls, 'head', head)
        setattr(cls, 'tail', tail)

    for cls in DATAFRAME_TYPE:
        setattr(cls, 'set_index', set_index)
        setattr(cls, '__getitem__', dataframe_getitem)
        setattr(cls, '__setitem__', dataframe_setitem)
    for cls in SERIES_TYPE:
        setattr(cls, '__getitem__', series_getitem)
Beispiel #2
0
def _install():
    from pandas.util import cache_readonly
    from ..operands import DATAFRAME_TYPE, SERIES_TYPE, INDEX_TYPE
    from .at import at
    from .getitem import dataframe_getitem, series_getitem
    from .iat import iat
    from .iloc import iloc, head, tail, index_getitem, index_setitem
    from .insert import df_insert
    from .loc import loc
    from .reindex import reindex, reindex_like
    from .rename import df_rename, series_rename, index_rename, index_set_names
    from .rename_axis import rename_axis
    from .reset_index import df_reset_index, series_reset_index
    from .set_index import set_index
    from .setitem import dataframe_setitem
    from .where import mask, where
    from .set_axis import df_set_axis, series_set_axis
    from .sample import sample
    from .add_prefix import df_add_prefix, series_add_prefix

    for cls in DATAFRAME_TYPE + SERIES_TYPE:
        setattr(cls, 'iloc', cache_readonly(iloc))
        setattr(cls, 'loc', cache_readonly(loc))
        setattr(cls, 'iat', cache_readonly(iat))
        setattr(cls, 'at', cache_readonly(at))
        setattr(cls, 'head', head)
        setattr(cls, 'reindex', reindex)
        setattr(cls, 'reindex_like', reindex_like)
        setattr(cls, 'rename_axis', rename_axis)
        setattr(cls, 'tail', tail)
        setattr(cls, 'mask', mask)
        setattr(cls, 'where', where)
        setattr(cls, 'sample', sample)

    for cls in DATAFRAME_TYPE:
        setattr(cls, 'set_index', set_index)
        setattr(cls, '__getitem__', dataframe_getitem)
        setattr(cls, '__setitem__', dataframe_setitem)
        setattr(cls, 'insert', df_insert)
        setattr(cls, 'reset_index', df_reset_index)
        setattr(cls, 'rename', df_rename)
        setattr(cls, 'set_axis', df_set_axis)
        setattr(cls, 'add_prefix', df_add_prefix)

    for cls in SERIES_TYPE:
        setattr(cls, '__getitem__', series_getitem)
        setattr(cls, 'reset_index', series_reset_index)
        setattr(cls, 'rename', series_rename)
        setattr(cls, 'set_axis', series_set_axis)
        setattr(cls, 'add_prefix', series_add_prefix)

    for cls in INDEX_TYPE:
        setattr(cls, '__getitem__', index_getitem)
        setattr(cls, '__setitem__', index_setitem)
        setattr(cls, 'rename', index_rename)
        setattr(cls, 'set_names', index_set_names)
Beispiel #3
0
def _install():
    from pandas.util import cache_readonly
    from ..operands import DATAFRAME_TYPE, SERIES_TYPE, INDEX_TYPE
    from .at import at
    from .getitem import dataframe_getitem, series_getitem
    from .iat import iat
    from .iloc import iloc, head, tail, index_getitem, index_setitem
    from .insert import df_insert
    from .loc import loc
    from .reindex import reindex, reindex_like
    from .rename import df_rename, series_rename, index_rename, index_set_names
    from .rename_axis import rename_axis
    from .reset_index import df_reset_index, series_reset_index
    from .set_index import set_index
    from .setitem import dataframe_setitem
    from .where import mask, where
    from .set_axis import df_set_axis, series_set_axis
    from .sample import sample
    from .add_prefix import df_add_prefix, series_add_prefix

    for cls in DATAFRAME_TYPE + SERIES_TYPE:
        setattr(cls, "iloc", cache_readonly(iloc))
        setattr(cls, "loc", cache_readonly(loc))
        setattr(cls, "iat", cache_readonly(iat))
        setattr(cls, "at", cache_readonly(at))
        setattr(cls, "head", head)
        setattr(cls, "reindex", reindex)
        setattr(cls, "reindex_like", reindex_like)
        setattr(cls, "rename_axis", rename_axis)
        setattr(cls, "tail", tail)
        setattr(cls, "mask", mask)
        setattr(cls, "where", where)
        setattr(cls, "sample", sample)

    for cls in DATAFRAME_TYPE:
        setattr(cls, "set_index", set_index)
        setattr(cls, "__getitem__", dataframe_getitem)
        setattr(cls, "__setitem__", dataframe_setitem)
        setattr(cls, "insert", df_insert)
        setattr(cls, "reset_index", df_reset_index)
        setattr(cls, "rename", df_rename)
        setattr(cls, "set_axis", df_set_axis)
        setattr(cls, "add_prefix", df_add_prefix)

    for cls in SERIES_TYPE:
        setattr(cls, "__getitem__", series_getitem)
        setattr(cls, "reset_index", series_reset_index)
        setattr(cls, "rename", series_rename)
        setattr(cls, "set_axis", series_set_axis)
        setattr(cls, "add_prefix", series_add_prefix)

    for cls in INDEX_TYPE:
        setattr(cls, "__getitem__", index_getitem)
        setattr(cls, "__setitem__", index_setitem)
        setattr(cls, "rename", index_rename)
        setattr(cls, "set_names", index_set_names)
Beispiel #4
0
def _install():
    from pandas.util import cache_readonly
    from ..operands import DATAFRAME_TYPE, SERIES_TYPE, INDEX_TYPE
    from .at import at
    from .getitem import dataframe_getitem, series_getitem
    from .iat import iat
    from .iloc import iloc, head, tail
    from .insert import df_insert
    from .loc import loc
    from .rename import df_rename, series_rename, index_rename, index_set_names
    from .rename_axis import rename_axis
    from .reset_index import df_reset_index, series_reset_index
    from .set_index import set_index
    from .setitem import dataframe_setitem
    from .reindex import reindex
    from .where import mask, where

    for cls in DATAFRAME_TYPE + SERIES_TYPE:
        setattr(cls, 'iloc', cache_readonly(iloc))
        setattr(cls, 'loc', cache_readonly(loc))
        setattr(cls, 'iat', cache_readonly(iat))
        setattr(cls, 'at', cache_readonly(at))
        setattr(cls, 'reindex', reindex)
        setattr(cls, 'head', head)
        setattr(cls, 'rename_axis', rename_axis)
        setattr(cls, 'tail', tail)
        setattr(cls, 'mask', mask)
        setattr(cls, 'where', where)

    for cls in DATAFRAME_TYPE:
        setattr(cls, 'set_index', set_index)
        setattr(cls, '__getitem__', dataframe_getitem)
        setattr(cls, '__setitem__', dataframe_setitem)
        setattr(cls, 'insert', df_insert)
        setattr(cls, 'reset_index', df_reset_index)
        setattr(cls, 'rename', df_rename)

    for cls in SERIES_TYPE:
        setattr(cls, '__getitem__', series_getitem)
        setattr(cls, 'reset_index', series_reset_index)
        setattr(cls, 'rename', series_rename)

    for cls in INDEX_TYPE:
        setattr(cls, 'rename', index_rename)
        setattr(cls, 'set_names', index_set_names)

    # make sure operand is registered
    from .set_label import DataFrameSetLabel
    del DataFrameSetLabel