示例#1
0
 def safe_na_op(lvalues, rvalues):
     try:
         with np.errstate(all='ignore'):
             return na_op(lvalues, rvalues)
     except Exception:
         if isinstance(rvalues, ABCSeries):
             if is_object_dtype(rvalues):
                 # if dtype is object, try elementwise op
                 return libalgos.arrmap_object(rvalues,
                                               lambda x: op(lvalues, x))
         else:
             if is_object_dtype(lvalues):
                 return libalgos.arrmap_object(lvalues,
                                               lambda x: op(x, rvalues))
         raise
示例#2
0
文件: ops.py 项目: jess010/pandas
 def safe_na_op(lvalues, rvalues):
     try:
         with np.errstate(all='ignore'):
             return na_op(lvalues, rvalues)
     except Exception:
         if isinstance(rvalues, ABCSeries):
             if is_object_dtype(rvalues):
                 # if dtype is object, try elementwise op
                 return libalgos.arrmap_object(rvalues,
                                               lambda x: op(lvalues, x))
         else:
             if is_object_dtype(lvalues):
                 return libalgos.arrmap_object(lvalues,
                                               lambda x: op(x, rvalues))
         raise
示例#3
0
 def safe_na_op(lvalues, rvalues):
     try:
         with np.errstate(all='ignore'):
             return na_op(lvalues, rvalues)
     except Exception:
         if is_object_dtype(lvalues):
             return libalgos.arrmap_object(lvalues,
                                           lambda x: op(x, rvalues))
         raise
示例#4
0
文件: ops.py 项目: dmjvictory/pandas
 def safe_na_op(lvalues, rvalues):
     try:
         with np.errstate(all='ignore'):
             return na_op(lvalues, rvalues)
     except Exception:
         if is_object_dtype(lvalues):
             return libalgos.arrmap_object(lvalues,
                                           lambda x: op(x, rvalues))
         raise