Skip to content

WIP: ENH Add float[pyarrow] dtype #47027

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 22 commits into from
Closed
Changes from 1 commit
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
Prev Previous commit
Next Next commit
add more methods
  • Loading branch information
gsheni committed May 12, 2022
commit 39c01ac3eda61336fe38c57efb5ca21daeb300ec
24 changes: 24 additions & 0 deletions pandas/core/arrays/arrow/array.py
Original file line number Diff line number Diff line change
Expand Up @@ -494,3 +494,27 @@ def mean(self, skipna=True):
return pa.compute.mean(self._data, skip_nulls=skipna)
else:
raise TypeError(f"Cannot compute mean from '{string}'")

def max(self, skipna=True):
if self.dtype._is_numeric:
return pa.compute.max(self._data, skip_nulls=skipna)
else:
raise TypeError(f"Cannot compute max from '{string}'")

def min(self, skipna=True):
if self.dtype._is_numeric:
return pa.compute.min(self._data, skip_nulls=skipna)
else:
raise TypeError(f"Cannot compute min from '{string}'")

def mode(self, skipna=True):
if self.dtype._is_numeric:
return pa.compute.mode(self._data, skip_nulls=skipna)
else:
raise TypeError(f"Cannot compute mode from '{string}'")

def quantile(self, q=0.5, interpolation='linear'):
if self.dtype._is_numeric:
return pa.compute.quantile(self._data, q=q, interpolation=interpolation)
else:
raise TypeError(f"Cannot compute quantile from '{string}'")