Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
a9ca0fa
ENH/PERF: enable column-wise reductions for EA-backed columns
jorisvandenbossche Mar 20, 2020
21aee0d
fix numeric_only for EAs
jorisvandenbossche Mar 20, 2020
9f83f6e
fix _reduce_columns call
jorisvandenbossche Mar 20, 2020
a9706e0
move EA._reduce call into blk_func
jorisvandenbossche Mar 20, 2020
07372e3
reuse blk_func for column-wise, inline _iter_arrays
jorisvandenbossche Mar 20, 2020
2d08450
temp
jorisvandenbossche Mar 20, 2020
c7f1dae
Merge remote-tracking branch 'upstream/master' into EA-column-wise-re…
jorisvandenbossche Mar 27, 2020
9e2a780
first attempts of going block-wise with numeric_only=None
jorisvandenbossche Mar 27, 2020
7f847e8
Merge remote-tracking branch 'upstream/master' into EA-column-wise-re…
jorisvandenbossche Apr 3, 2020
594d2b0
TEMP
jorisvandenbossche Apr 3, 2020
3d62e68
Merge remote-tracking branch 'upstream/master' into EA-column-wise-re…
jorisvandenbossche Apr 24, 2020
5b0370e
use iter_column_arrays
jorisvandenbossche May 29, 2020
6e3c287
Merge remote-tracking branch 'upstream/master' into EA-column-wise-re…
jorisvandenbossche May 29, 2020
7088cfc
intermediate clean-up: remove BM.reduce changes + do column-wise for …
jorisvandenbossche May 29, 2020
925d660
fixup
jorisvandenbossche May 29, 2020
852331e
fix dtype of empty result
jorisvandenbossche May 30, 2020
1c9a685
Merge remote-tracking branch 'upstream/master' into EA-column-wise-re…
jorisvandenbossche Jun 6, 2020
34731f2
clean-up
jorisvandenbossche Jun 6, 2020
a8e61d0
whitespace
jorisvandenbossche Jun 6, 2020
f233109
Merge remote-tracking branch 'upstream/master' into EA-column-wise-re…
jorisvandenbossche Jun 15, 2020
ec65c57
Merge remote-tracking branch 'upstream/master' into EA-column-wise-re…
jorisvandenbossche Jul 12, 2020
15ec9b6
add test case for GH34520, copied from GH35112
jorisvandenbossche Jul 12, 2020
2653d02
add test to ensure EA op is used for integer array
jorisvandenbossche Jul 12, 2020
64e0069
remove try except
jorisvandenbossche Jul 12, 2020
bb0a47b
remove unused code
jorisvandenbossche Jul 12, 2020
9323f0e
add test for GH32651, copied from GH34210
jorisvandenbossche Jul 12, 2020
eb33f86
remove check for EAs for block-wise path
jorisvandenbossche Jul 12, 2020
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 test for GH32651, copied from GH34210
Co-authored-by: Simon Hawkins <simonjayhawkins@gmail.com>
  • Loading branch information
jorisvandenbossche and simonjayhawkins committed Jul 12, 2020
commit 9323f0e74be37cf9239673b2810c2750419051e5
2 changes: 1 addition & 1 deletion pandas/core/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -8623,7 +8623,7 @@ def _constructor(df, result, index=None):
df = _get_data(axis_matters=True)

if numeric_only is not None:
result = [op(arr) for arr in df._iter_column_arrays()]
result = [array_func(arr) for arr in df._iter_column_arrays()]
return _constructor(df, result)
else:
# with numeric_only=None, need to ignore exceptions per column
Expand Down
14 changes: 14 additions & 0 deletions pandas/tests/frame/test_analytics.py
Original file line number Diff line number Diff line change
Expand Up @@ -1312,3 +1312,17 @@ def test_mixed_frame_with_integer_sum():
result = df.sum()
expected = pd.Series(["a", 1], index=["a", "b"])
tm.assert_series_equal(result, expected)


@pytest.mark.parametrize("numeric_only", [True, False, None])
@pytest.mark.parametrize("method", ["min", "max"])
def test_minmax_extensionarray(method, numeric_only):
# https://github.com/pandas-dev/pandas/issues/32651
int64_info = np.iinfo("int64")
ser = Series([int64_info.max, None, int64_info.min], dtype=pd.Int64Dtype())
df = DataFrame({"Int64": ser})
result = getattr(df, method)(numeric_only=numeric_only)
expected = Series(
[getattr(int64_info, method)], index=pd.Index(["Int64"], dtype="object")
)
tm.assert_series_equal(result, expected)