def where(self, other, cond, align=True, errors='<STR_LIT>',<EOL>try_cast=False, axis=<NUM_LIT:0>, transpose=False):
import pandas.core.computation.expressions as expressions<EOL>assert errors in ['<STR_LIT>', '<STR_LIT:ignore>']<EOL>values = self.values<EOL>orig_other = other<EOL>if transpose:<EOL><INDENT>values = values.T<EOL><DEDENT>other = getattr(other, '<STR_LIT>', getattr(other, '<STR_LIT>', other))<EOL>cond = getattr(cond, '<STR_LIT>', cond)<EOL>if getattr(other, '<STR_LIT>', <NUM_LIT:0>) >= <NUM_LIT:1>:<EOL><INDENT>if values.ndim - <NUM_LIT:1> == other.ndim and axis == <NUM_LIT:1>:<EOL><INDENT>other = other.reshape(tuple(other.shape + (<NUM_LIT:1>, )))<EOL><DEDENT>elif transpose and values.ndim == self.ndim - <NUM_LIT:1>:<EOL><INDENT>cond = cond.T<EOL><DEDENT><DEDENT>if not hasattr(cond, '<STR_LIT>'):<EOL><INDENT>raise ValueError("<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT>def func(cond, values, other):<EOL><INDENT>if cond.ravel().all():<EOL><INDENT>return values<EOL><DEDENT>values, other = self._try_coerce_args(values, other)<EOL>try:<EOL><INDENT>return self._try_coerce_result(expressions.where(<EOL>cond, values, other))<EOL><DEDENT>except Exception as detail:<EOL><INDENT>if errors == '<STR_LIT>':<EOL><INDENT>raise TypeError(<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'.format(other=other, detail=detail))<EOL><DEDENT>else:<EOL><INDENT>result = np.empty(values.shape, dtype='<STR_LIT>')<EOL>result.fill(np.nan)<EOL>return result<EOL><DEDENT><DEDENT><DEDENT>try:<EOL><INDENT>result = func(cond, values, other)<EOL><DEDENT>except TypeError:<EOL><INDENT>block = self.coerce_to_target_dtype(other)<EOL>blocks = block.where(orig_other, cond, align=align,<EOL>errors=errors,<EOL>try_cast=try_cast, axis=axis,<EOL>transpose=transpose)<EOL>return self._maybe_downcast(blocks, '<STR_LIT>')<EOL><DEDENT>if self._can_hold_na or self.ndim == <NUM_LIT:1>:<EOL><INDENT>if transpose:<EOL><INDENT>result = result.T<EOL><DEDENT>if try_cast:<EOL><INDENT>result = self._try_cast_result(result)<EOL><DEDENT>return self.make_block(result)<EOL><DEDENT>axis = cond.ndim - <NUM_LIT:1><EOL>cond = cond.swapaxes(axis, <NUM_LIT:0>)<EOL>mask = np.array([cond[i].all() for i in range(cond.shape[<NUM_LIT:0>])],<EOL>dtype=bool)<EOL>result_blocks = []<EOL>for m in [mask, ~mask]:<EOL><INDENT>if m.any():<EOL><INDENT>r = self._try_cast_result(result.take(m.nonzero()[<NUM_LIT:0>],<EOL>axis=axis))<EOL>result_blocks.append(<EOL>self.make_block(r.T, placement=self.mgr_locs[m]))<EOL><DEDENT><DEDENT>return result_blocks<EOL>
evaluate the block; return result block(s) from the result

Parameters
----------
other : a ndarray/object
cond  : the condition to respect
align : boolean, perform alignment on other/cond
errors : str, {'raise', 'ignore'}, default 'raise'
    - ``raise`` : allow exceptions to be raised
    - ``ignore`` : suppress exceptions. On error return original object

axis : int
transpose : boolean
    Set to True if self is stored with axes reversed

Returns
-------
a new block(s), the result of the func