From 6917c9bacf1ffb4e38d2bfbf17a3c96d4395864d Mon Sep 17 00:00:00 2001 From: Brock Date: Tue, 9 Jun 2020 14:08:58 -0700 Subject: [PATCH 1/2] CLN: dont consolidate in NDFrame._is_numeric_mixed_type --- pandas/core/generic.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 6183638ab587e..05d0a30b3ffc5 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -5335,8 +5335,7 @@ def _is_mixed_type(self) -> bool_t: @property def _is_numeric_mixed_type(self) -> bool_t: - f = lambda: self._mgr.is_numeric_mixed_type - return self._protect_consolidate(f) + return self._mgr.is_numeric_mixed_type def _check_inplace_setting(self, value) -> bool_t: """ check whether we allow in-place setting with this type of value """ From 9466a540e650c8b462bf9f39d3e3b4407d0e3b53 Mon Sep 17 00:00:00 2001 From: Brock Date: Wed, 10 Jun 2020 07:59:14 -0700 Subject: [PATCH 2/2] inline --- pandas/core/generic.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 05d0a30b3ffc5..8a06e8fe79805 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -5333,14 +5333,10 @@ def _is_mixed_type(self) -> bool_t: f = lambda: self._mgr.is_mixed_type return self._protect_consolidate(f) - @property - def _is_numeric_mixed_type(self) -> bool_t: - return self._mgr.is_numeric_mixed_type - def _check_inplace_setting(self, value) -> bool_t: """ check whether we allow in-place setting with this type of value """ if self._is_mixed_type: - if not self._is_numeric_mixed_type: + if not self._mgr.is_numeric_mixed_type: # allow an actual np.nan thru if is_float(value) and np.isnan(value):