From 14327a77cc0de988ee4a6b265e9daea93d49682d Mon Sep 17 00:00:00 2001 From: Jeff Reback Date: Tue, 4 Jul 2017 18:37:10 -0400 Subject: [PATCH] try try again --- pandas/core/internals.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/pandas/core/internals.py b/pandas/core/internals.py index 074529fe318092..4559464c35ee14 100644 --- a/pandas/core/internals.py +++ b/pandas/core/internals.py @@ -384,10 +384,14 @@ def fillna(self, value, limit=None, inplace=False, downcast=None, # fillna, but if we cannot coerce, then try again as an ObjectBlock try: + print("_try_coerce_args: {}".format(value)) values, _, _, _ = self._try_coerce_args(self.values, value) + print("putmask") blocks = self.putmask(mask, value, inplace=inplace) + print("coerce") blocks = [b.make_block(values=self._try_coerce_result(b.values)) for b in blocks] + print("downcast") return self._maybe_downcast(blocks, downcast) except (TypeError, ValueError): @@ -397,16 +401,11 @@ def fillna(self, value, limit=None, inplace=False, downcast=None, # operate column-by-column def f(m, v, i): - print("value: {}".format(value)) - print("block: {}".format(self)) - # try again with a compatible block block = self.coerce_to_target_dtype(value) - print("coerced block: {}".format(block)) - return block.fillna(value, limit=limit, inplace=inplace, - downcast=False) + downcast=None) return self.split_and_operate(mask, f, inplace)