From d572f23bd4570c11718bcabf5516317484b97d3d Mon Sep 17 00:00:00 2001 From: jbrockmendel Date: Tue, 17 Sep 2019 08:43:24 -0700 Subject: [PATCH] CLN: Exception --- pandas/core/generic.py | 25 ++++--------------------- 1 file changed, 4 insertions(+), 21 deletions(-) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 68308b2f83b60..8429d9464266b 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -4524,10 +4524,7 @@ def reindex(self, *args, **kwargs): # check if we are a multi reindex if self._needs_reindex_multi(axes, method, level): - try: - return self._reindex_multi(axes, copy, fill_value) - except Exception: - pass + return self._reindex_multi(axes, copy, fill_value) # perform the reindex on the axes return self._reindex_axes( @@ -9050,23 +9047,9 @@ def _where( # try to not change dtype at first (if try_quick) if try_quick: - - try: - new_other = com.values_from_object(self) - new_other = new_other.copy() - new_other[icond] = other - other = new_other - except Exception: - try_quick = False - - # let's create a new (if we failed at the above - # or not try_quick - if not try_quick: - - dtype, fill_value = maybe_promote(other.dtype) - new_other = np.empty(len(icond), dtype=dtype) - new_other.fill(fill_value) - maybe_upcast_putmask(new_other, icond, other) + new_other = com.values_from_object(self) + new_other = new_other.copy() + new_other[icond] = other other = new_other else: