/usr/local/lib64/python3.6/site-packages/pandas/tests/arithmetic/__pycache__
Edit: /usr/local/lib64/python3.6/site-packages/pandas/tests/arithmetic/__pycache__/common.cpython-36.pyc (2425B)
3
:%Egc @ sP d Z ddlZddlZddlmZmZmZ ddlj Z
d
ddZdd Zdd Z
dS )z)
Assertion helpers for arithmetic tests.
N) DataFrameIndexSeriesc C s t jt|d | | W dQ R X t jt|d || W dQ R X t jt|d | | W dQ R X t jt|d || W dQ R X dS )z
Helper to assert that left and right can be neither added nor subtracted.
Parameters
----------
left : object
right : object
msg : str or None, default None
)matchN)pytestraises TypeError)leftrightmsg r J/usr/local/lib64/python3.6/site-packages/pandas/tests/arithmetic/common.pyassert_invalid_addsub_type s
r c C sF | t kst|t rt S | tks(t|tr,tS | tks>t|trBtS | S )z?
Given two box-types, find the one that takes priority
)r
isinstancer r )boxZvectorr r r
get_upcast_box s r c : C s |t k r|ntj}| |k}|tj|jtjd}tj|| || k}tj|| | |k}tj|| || k}tj|| djdddddg}t j
t|d | |k W d Q R X t j
t|d | |k W d Q R X t j
t|d | |k W d Q R X t j
t|d | |k W d Q R X t j
t|d || k W d Q R X t j
t|d || k W d Q R X t j
t|d || k W d Q R X t j
t|d || k W d Q R X d S )
z
Assert that comparison operations with mismatched types behave correctly.
Parameters
----------
left : np.ndarray, ExtensionArray, Index, or Series
right : object
box : {pd.DataFrame, pd.Series, pd.Index, tm.to_array}
)Zdtype|zInvalid comparison betweenzCannot compare typeznot supported betweenzinvalid type promotionzThe DTypes
and do not have a common DType. For example they cannot be stored in a single array unless the dtype is `object`.)r N)r nparrayZzerosshapeZbool_tmZassert_equaljoinr r r )r r
r Zxboxresultexpectedr r r r
assert_invalid_comparison, s@
r )N)__doc__Znumpyr r Zpandasr r r Zpandas._testingZ_testingr r r r r r r r
s