ModinDtypes#

Public API#

class modin.core.dataframe.pandas.metadata.dtypes.ModinDtypes(value: Optional[Union[Callable, Series, DtypesDescriptor, ModinDtypes]])#

A class that hides the various implementations of the dtypes needed for optimization.

Parameters:

value (pandas.Series, callable, DtypesDescriptor or ModinDtypes, optional) –

classmethod concat(values: list, axis: int = 0) ModinDtypes#

Concatenate dtypes.

Parameters:
  • values (list of DtypesDescriptors, pandas.Series, ModinDtypes and Nones) –

  • axis (int, default: 0) – If axis == 0: concatenate column names. This implements the logic of how dtypes are combined on pd.concat([df1, df2], axis=1). If axis == 1: perform a union join for the column names described by values and then find common dtypes for the columns appeared to be in an intersection. This implements the logic of how dtypes are combined on pd.concat([df1, df2], axis=0).dtypes.

Return type:

ModinDtypes

copy() ModinDtypes#

Copy an object without materializing the internal representation.

Return type:

ModinDtypes

get() Series#

Get the materialized internal representation.

Return type:

pandas.Series

get_dtypes_set() set[numpy.dtype]#

Get a set of dtypes from the descriptor.

Return type:

set[np.dtype]

property is_materialized: bool#

Check if the internal representation is materialized.

Return type:

bool

lazy_get(ids: list, numeric_index: bool = False) ModinDtypes#

Get new ModinDtypes for a subset of columns without triggering any computations.

Parameters:
  • ids (list of index labels or positional indexers) – Columns for the subset.

  • numeric_index (bool, default: False) – Whether ids are positional indixes or column labels to take.

Returns:

ModinDtypes that describes dtypes for columns specified in ids.

Return type:

ModinDtypes

maybe_specify_new_frame_ref(new_parent: PandasDataframe) ModinDtypes#

Set a new parent for the stored value if needed.

Parameters:

new_parent (PandasDataframe) –

Returns:

A copy of ModinDtypes with updated parent.

Return type:

ModinDtypes

set_index(new_index: Union[Index, ModinIndex]) ModinDtypes#

Set new column names for stored dtypes.

Parameters:

new_index (pandas.Index or ModinIndex) –

Returns:

New ModinDtypes with updated column names.

Return type:

ModinDtypes