Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions modin/data_management/data_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,10 @@ def add(self, other, **kwargs):
def div(self, other, **kwargs):
func = pandas.DataFrame.div
return self._inter_df_op_handler(func, other, **kwargs)

def rdiv(self, other, **kwargs):
func = pandas.DataFrame.rdiv
return self._inter_df_op_handler(func, other, **kwargs)

def eq(self, other, **kwargs):
func = pandas.DataFrame.eq
Expand Down Expand Up @@ -405,10 +409,18 @@ def pow(self, other, **kwargs):
func = pandas.DataFrame.pow
return self._inter_df_op_handler(func, other, **kwargs)

def rpow(self, other, **kwargs):
func = pandas.DataFrame.rpow
return self._inter_df_op_handler(func, other, **kwargs)

def sub(self, other, **kwargs):
func = pandas.DataFrame.sub
return self._inter_df_op_handler(func, other, **kwargs)

def rsub(self, other, **kwargs):
func = pandas.DataFrame.rsub
return self._inter_df_op_handler(func, other, **kwargs)

def truediv(self, other, **kwargs):
func = pandas.DataFrame.truediv
return self._inter_df_op_handler(func, other, **kwargs)
Expand Down
68 changes: 65 additions & 3 deletions modin/pandas/dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -2721,7 +2721,27 @@ def rank(self,
pct=pct))

def rdiv(self, other, axis='columns', level=None, fill_value=None):
return self.div(other, axis, level, fill_value)
"""Div this DataFrame against another DataFrame/Series/scalar.

Args:
other: The object to use to apply the div against this.
axis: The axis to div over.
level: The Multilevel index level to apply div over.
fill_value: The value to fill NaNs with.

Returns:
A new DataFrame with the rdiv applied.
"""
if level is not None:
raise NotImplementedError("Mutlilevel index not yet supported "
"in Pandas on Ray")

other = self._validate_other(other, axis)
new_manager = self._data_manager.rdiv(other=other,
axis=axis,
level=level,
fill_value=fill_value)
return self._create_dataframe_from_manager(new_manager)

def reindex(self,
labels=None,
Expand Down Expand Up @@ -2974,10 +2994,52 @@ def round(self, decimals=0, *args, **kwargs):
return DataFrame(data_manager=self._data_manager.round(decimals=decimals, **kwargs))

def rpow(self, other, axis='columns', level=None, fill_value=None):
return self.pow(other, axis, level, fill_value)
"""Pow this DataFrame against another DataFrame/Series/scalar.

Args:
other: The object to use to apply the pow against this.
axis: The axis to pow over.
level: The Multilevel index level to apply pow over.
fill_value: The value to fill NaNs with.

Returns:
A new DataFrame with the Pow applied.
"""
if level is not None:
raise NotImplementedError("Mutlilevel index not yet supported "
"in Pandas on Ray")

other = self._validate_other(other, axis)
new_manager = self._data_manager.rpow(other=other,
axis=axis,
level=level,
fill_value=fill_value)

return self._create_dataframe_from_manager(new_manager)


def rsub(self, other, axis='columns', level=None, fill_value=None):
return self.sub(other, axis, level, fill_value)
"""Subtract a DataFrame/Series/scalar from this DataFrame.

Args:
other: The object to use to apply the subtraction to this.
axis: THe axis to apply the subtraction over.
level: Mutlilevel index level to subtract over.
fill_value: The value to fill NaNs with.

Returns:
A new DataFrame with the subtraciont applied.
"""
if level is not None:
raise NotImplementedError("Mutlilevel index not yet supported "
"in Pandas on Ray")

other = self._validate_other(other, axis)
new_manager = self._data_manager.rsub(other=other,
axis=axis,
level=level,
fill_value=fill_value)
return self._create_dataframe_from_manager(new_manager)

def rtruediv(self, other, axis='columns', level=None, fill_value=None):
return self.truediv(other, axis, level, fill_value)
Expand Down