ó
˜íYc           @   s"   d  d l  Z d g Z d „  Z d S(   iÿÿÿÿNt   replacec         C   sÒ   t  |  ƒ t j k	 r$ t d ƒ ‚ n  t |  j j  t j ƒ s‘ | | k rL d St | ƒ | k rm t d ƒ ‚ n  t | ƒ | k r‘ t d ƒ ‚ q‘ n  | | k r¯ t j	 |  ƒ } n |  | k } t j
 |  | | ƒ d S(   s5   Slow replace (inplace) used for unaccelerated dtypes.s   `a` must be a numpy array.Ns    Cannot safely cast `old` to int.s    Cannot safely cast `new` to int.(   t   typet   npt   ndarrayt	   TypeErrort
   issubclasst   dtypet   inexactt   intt
   ValueErrort   isnant   putmask(   t   at   oldt   newt   mask(    (    s8   lib/python2.7/site-packages/bottleneck/slow/nonreduce.pyR       s    (   t   numpyR   t   __all__R    (    (    (    s8   lib/python2.7/site-packages/bottleneck/slow/nonreduce.pyt   <module>   s   	