Skip to content

Commit

Permalink
numpy integer division breaks on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
ritchie46 committed Sep 16, 2021
1 parent 5a4176e commit ad4a931
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions py-polars/polars/eager/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,14 +350,9 @@ def __sub__(self, other: Any) -> "Series":

def __truediv__(self, other: Any) -> "Series":
physical_type = date_like_to_physical(self.dtype)
if self.dtype != physical_type:
if self.dtype != physical_type or self.is_float():
return self.__floordiv__(other)

if self.is_float():
out_dtype = self.dtype
else:
out_dtype = Float64
return np.true_divide(self, other, dtype=out_dtype) # type: ignore
return self.cast(pl.Float64) / other

def __floordiv__(self, other: Any) -> "Series":
if isinstance(other, Series):
Expand Down

0 comments on commit ad4a931

Please sign in to comment.