How to use the modin.backends.pandas.parsers.find_common_type_cat function in modin

To help you get started, we’ve selected a few modin examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github modin-project / modin / modin / engines / base / frame / data.py View on Github external
def _compute_map_reduce_metadata(self, axis, new_parts):
        if axis == 0:
            columns = self.columns
            index = ["__reduced__"]
            new_lengths = [1]
            new_widths = self._column_widths
            new_dtypes = self._dtypes
        else:
            columns = ["__reduced__"]
            index = self.index
            new_lengths = self._row_lengths
            new_widths = [1]
            if self._dtypes is not None:
                new_dtypes = pandas.Series(
                    np.full(1, find_common_type(self.dtypes.values)),
                    index=["__reduced__"],
                )
            else:
                new_dtypes = self._dtypes
        return self.__constructor__(
            new_parts, index, columns, new_lengths, new_widths, new_dtypes
        )
github modin-project / modin / modin / engines / base / frame / data.py View on Github external
            return df.apply(lambda col: find_common_type(col.values), axis=0)
github modin-project / modin / modin / engines / base / frame / data.py View on Github external
            .apply(lambda row: find_common_type(row.values), axis=1)
            .squeeze(axis=0)
github modin-project / modin / modin / engines / ray / pandas_on_ray / frame / data.py View on Github external
            .apply(lambda row: find_common_type(row.values), axis=1)
            .squeeze(axis=0)
github modin-project / modin / modin / engines / base / frame / data.py View on Github external
def transpose(self):
        """Transpose the index and columns of this dataframe.

        Returns:
            A new dataframe.
        """
        new_partitions = self._frame_mgr_cls.lazy_map_partitions(
            self._partitions, lambda df: df.T
        ).T
        new_dtypes = pandas.Series(
            np.full(len(self.index), find_common_type(self.dtypes.values)),
            index=self.index,
        )
        return self.__constructor__(
            new_partitions,
            self.columns,
            self.index,
            self._column_widths,
            self._row_lengths,
            dtypes=new_dtypes,
        )