HOME


sh-3ll 1.0
DIR:/usr/local/lib64/python3.6/site-packages/pandas/core/ops/__pycache__/
Upload File :
Current File : //usr/local/lib64/python3.6/site-packages/pandas/core/ops/__pycache__/invalid.cpython-36.pyc
3

���h�@s.dZddlZddlZdd�Zed�dd�ZdS)z#
Templates for invalid operations.
�NcCs\|tjkrtj|jtd�}n<|tjkr8tj|jtd�}n t|�j	}t
d|j�d|����|S)a�
    If a comparison has mismatched types and is not necessarily meaningful,
    follow python3 conventions by:

        - returning all-False for equality
        - returning all-True for inequality
        - raising TypeError otherwise

    Parameters
    ----------
    left : array-like
    right : scalar, array-like
    op : operator.{eq, ne, lt, le, gt}

    Raises
    ------
    TypeError : on inequality comparisons
    )�dtypez!Invalid comparison between dtype=z and )�operator�eq�np�zeros�shape�bool�neZones�type�__name__�	TypeErrorr)�left�right�opZ
res_values�typ�r�9/tmp/pip-build-5_djhm0z/pandas/pandas/core/ops/invalid.py�invalid_comparison	s


r)�namecsd�fdd�	}�|_|S)z�
    Return a binary method that always raises a TypeError.

    Parameters
    ----------
    name : str

    Returns
    -------
    invalid_op : function
    Ncs"t|�j}td��d|����dS)Nzcannot perform z with this index type: )r
rr)�self�otherr)rrr�
invalid_op3s
z#make_invalid_op.<locals>.invalid_op)N)r)rrr)rr�make_invalid_op&s
r)�__doc__rZnumpyrr�strrrrrr�<module>s