Skip to content

Commit 6921c94

Browse files
committed
Merge branch 'add_numeric_only_gb' of https://github.com/rhshadrach/pandas into add_numeric_only_gb
2 parents 134313e + 58e9ddc commit 6921c94

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pandas/core/groupby/groupby.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2153,13 +2153,14 @@ def var(
21532153

21542154
return self._numba_agg_general(sliding_var, engine_kwargs, ddof)
21552155
else:
2156+
ignore_failures = numeric_only is lib.no_default
21562157
numeric_only = self._resolve_numeric_only(numeric_only)
21572158
if ddof == 1:
21582159
return self._cython_agg_general(
21592160
"var",
21602161
alt=lambda x: Series(x).var(ddof=ddof),
21612162
numeric_only=numeric_only,
2162-
ignore_failures=numeric_only,
2163+
ignore_failures=ignore_failures,
21632164
)
21642165
else:
21652166
func = lambda x: x.var(ddof=ddof)
@@ -2176,7 +2177,7 @@ def var(
21762177
):
21772178
with self._group_selection_context():
21782179
return self._python_agg_general(
2179-
func, raise_on_typeerror=not numeric_only
2180+
func, raise_on_typeerror=not ignore_failures
21802181
)
21812182

21822183
@final

0 commit comments

Comments
 (0)