Current File : //proc/self/root/proc/self/root/lib64/python2.7/site-packages/numpy/lib/recfunctions.pyc
�
E�`Qc@s�dZddlZddlZddlZddljZddlmZmZddlm	Z	ddl
mZddlm
Z
ejjjZddd	d
ddd
dddddgZd�Zd�Zd�Zd�Zed�Zddd�Zd�Zd�Zded�Zeed�Zdd�Zdeeed�Zeed�Z d �Z!d!�Z"ddeed"�Z#dd#�Z$deeed$�Z%deed%�Z&d&d'd(deed)�Z'd&d'd(dd*�Z(dS(+s�
Collection of utilities to manipulate structured arrays.

Most of these functions were initially implemented by John Hunter for matplotlib.
They have been rewritten and extended for convenience.


i����N(tndarraytrecarray(tMaskedArray(t
MaskedRecords(t_is_string_liket
append_fieldstdrop_fieldstfind_duplicatestget_fieldstructuretjoin_bytmerge_arraystrec_append_fieldstrec_drop_fieldstrec_jointrecursive_fill_fieldst
rename_fieldststack_arrayscCsz|j}xj|jD]_}y||}Wntk
r=qnX|jjr^t|||�q|||t|�*qW|S(sl
    Fills fields from output with fields from input,
    with support for nested structures.

    Parameters
    ----------
    input : ndarray
        Input array.
    output : ndarray
        Output array.

    Notes
    -----
    * `output` should be at least the same size as `input`

    Examples
    --------
    >>> from numpy.lib import recfunctions as rfn
    >>> a = np.array([(1, 10.), (2, 20.)], dtype=[('A', int), ('B', float)])
    >>> b = np.zeros((3,), dtype=a.dtype)
    >>> rfn.recursive_fill_fields(a, b)
    array([(1, 10.0), (2, 20.0), (0, 0.0)],
          dtype=[('A', '<i4'), ('B', '<f8')])

    (tdtypetnamest
ValueErrorRtlen(tinputtoutputtnewdtypetfieldtcurrent((s</usr/lib64/python2.7/site-packages/numpy/lib/recfunctions.pyR!s	
cCsrg}|j}xP|D]H}||}|jrQ|j|tt|��f�q|j|�qWt|�pqdS(s�
    Returns the field names of the input datatype as a tuple.

    Parameters
    ----------
    adtype : dtype
        Input datatype

    Examples
    --------
    >>> from numpy.lib import recfunctions as rfn
    >>> rfn.get_names(np.empty((1,), dtype=int)) is None
    True
    >>> rfn.get_names(np.empty((1,), dtype=[('A',int), ('B', float)]))
    ('A', 'B')
    >>> adtype = np.dtype([('a', int), ('b', [('ba', int), ('bb', int)])])
    >>> rfn.get_names(adtype)
    ('a', ('b', ('ba', 'bb')))
    N(Rtappendttuplet	get_namestNone(tadtypet	listnamesRtnameR((s</usr/lib64/python2.7/site-packages/numpy/lib/recfunctions.pyRIs	

	"cCsfg}|j}xD|D]<}|j|�||}|jr|jt|��qqWt|�pedS(s2
    Returns the field names of the input datatype as a tuple. Nested structure
    are flattend beforehand.

    Parameters
    ----------
    adtype : dtype
        Input datatype

    Examples
    --------
    >>> from numpy.lib import recfunctions as rfn
    >>> rfn.get_names_flat(np.empty((1,), dtype=int)) is None
    True
    >>> rfn.get_names_flat(np.empty((1,), dtype=[('A',int), ('B', float)]))
    ('A', 'B')
    >>> adtype = np.dtype([('a', int), ('b', [('ba', int), ('bb', int)])])
    >>> rfn.get_names_flat(adtype)
    ('a', 'b', 'ba', 'bb')
    N(RRtextendtget_names_flatRR(RRRR R((s</usr/lib64/python2.7/site-packages/numpy/lib/recfunctions.pyR"hs	


	cCs�|j}|dkr|jSg}xS|D]K}|j|\}}|jra|jt|��q)|j||f�q)Wt|�SdS(sD
    Flatten a structured data-type description.

    Examples
    --------
    >>> from numpy.lib import recfunctions as rfn
    >>> ndtype = np.dtype([('a', '<i4'), ('b', [('ba', '<f8'), ('bb', '<i4')])])
    >>> rfn.flatten_descr(ndtype)
    (('a', dtype('int32')), ('ba', dtype('float64')), ('bb', dtype('int32')))

    N(RRtdescrtfieldsR!t
flatten_descrRR(tndtypeRR#Rttypt_((s</usr/lib64/python2.7/site-packages/numpy/lib/recfunctions.pyR%�s	
	cCs�g}|r6x�|D]}|jt|j��qWndxa|D]Y}|j}|jpXd}t|�dkr�|jd|jf�q=|j|j�q=Wtj|�jS(s�
    Combine the dtype description of a series of arrays.

    Parameters
    ----------
    seqarrays : sequence of arrays
        Sequence of arrays
    flatten : {boolean}, optional
        Whether to collapse nested descriptions.
    it((R!R%RRRRR#tnp(t	seqarraystflattenRtaRR((s</usr/lib64/python2.7/site-packages/numpy/lib/recfunctions.pyt	zip_descr�s

	cCs�|dkri}n|j}x�|D]�}||}|jrz|rT|g||<n
g||<|jt|||��q%g|j|g�p�gD]}|^q�}|r�|j|�n|r�|g}n|p�g||<q%W|p�dS(sj
    Returns a dictionary with fields as keys and a list of parent fields as values.

    This function is used to simplify access to fields nested in other fields.

    Parameters
    ----------
    adtype : np.dtype
        Input datatype
    lastname : optional
        Last processed field name (used internally during recursion).
    parents : dictionary
        Dictionary of parent fields (used interbally during recursion).

    Examples
    --------
    >>> from numpy.lib import recfunctions as rfn
    >>> ndtype =  np.dtype([('A', int),
    ...                     ('B', [('BA', int),
    ...                            ('BB', [('BBA', int), ('BBB', int)])])])
    >>> rfn.get_fieldstructure(ndtype)
    ... # XXX: possible regression, order of BBA and BBB is swapped
    {'A': [], 'B': [], 'BA': ['B'], 'BB': ['B'], 'BBA': ['B', 'BB'], 'BBB': ['B', 'BB']}

    N(RRtupdateRtgetR(RtlastnametparentsRR RR(t
lastparent((s</usr/lib64/python2.7/site-packages/numpy/lib/recfunctions.pyR�s"		

	
+ccsQxJ|D]B}t|tj�rDx'tt|��D]}|Vq2Wq|VqWdS(st
    Returns an iterator of concatenated fields from a sequence of arrays,
    collapsing any nested structure.
    N(t
isinstanceR*tvoidt_izip_fields_flatR(titerabletelementtf((s</usr/lib64/python2.7/site-packages/numpy/lib/recfunctions.pyR6�s

ccs�x�|D]�}t|d�rKt|t�rKxjt|�D]}|Vq9Wqt|tj�r�tt|��dkr�x!t|�D]}|Vq�Wq|VqWdS(sO
    Returns an iterator of concatenated fields from a sequence of arrays.
    t__iter__iN(thasattrR4t
basestringt_izip_fieldsR*R5RR(R7R8R9((s</usr/lib64/python2.7/site-packages/numpy/lib/recfunctions.pyR=�s
*c	cs�|gt|�djd�}tj|�}g|D]}tj||�|�^q6}|rit}nt}y/x(tj|�D]}t||��Vq�WWnt	k
r�nXdS(s)
    Returns an iterator of concatenated items from a sequence of arrays.

    Parameters
    ----------
    seqarray : sequence of arrays
        Sequence of arrays.
    fill_value : {None, integer}
        Value used to pad shorter iterables.
    flatten : {True, False},
        Whether to
    icss|�VdS(s*Yields the fill_value or raises IndexErrorN((tcounter((s</usr/lib64/python2.7/site-packages/numpy/lib/recfunctions.pytsentinelsN(
Rtpopt	itertoolstrepeattchainR6R=tizipRt
IndexError(	R+t
fill_valueR,R?tfillerstittiterstzipfuncttup((s</usr/lib64/python2.7/site-packages/numpy/lib/recfunctions.pytizip_recordss +	
cCsdt|t�st}n|r9|r`|jt�}q`n'tj|�}|r`|jt�}n|S(s�
    Private function: return a recarray, a ndarray, a MaskedArray
    or a MaskedRecords depending on the input parameters
    (R4RtFalsetviewRtmatfilledR(Rtusemaskt
asrecarray((s</usr/lib64/python2.7/site-packages/numpy/lib/recfunctions.pyt_fix_output(s	cCs{|jj}|j|j|j}}}xK|p5ij�D]7\}}||kr<|||<|||||<q<q<W|S(sp
    Update the fill_value and masked data of `output`
    from the default given in a dictionary defaults.
    (RRtdatatmaskRFt	iteritems(RtdefaultsRRTRURFtktv((s</usr/lib64/python2.7/site-packages/numpy/lib/recfunctions.pyt
_fix_defaults9s
c	Cst|�dkr(tj|d�}nt|ttjf�r�|j}|snt|fdt�|j	kr�|j
�}|js�d|fg}n|r�|r�t}q�t
}n|r�t}nt}|jd|d|�S|f}nttj|�}td�|D��}t|�}t|d|�}	g}
g}|r�x7tj||�D]#\}}
||
}|j
�j�}tj|�j
�}|r,t||j�}t|ttjf�r8t|j�dkr�|j�d}t}q)tj|d|jdd�}tjdd|j�}q8nd}t}|
jtj||g|��|jtj||g|��qUWtt|
d|��}tjtj |d|	d	|�d
t!t|d|���}|r|jt�}qn&x�tj||�D]�\}}
||
}|j
�j�}|r�t||j�}t|ttjf�r�t|j�dkr~|j�d}q�tj|d|jdd�}q�nd}|
jtj||g|��q�Wtj tt|
d|��d|	d	|�}|r|jt�}n|S(
s�
    Merge arrays field by field.

    Parameters
    ----------
    seqarrays : sequence of ndarrays
        Sequence of arrays
    fill_value : {float}, optional
        Filling value used to pad missing data on the shorter arrays.
    flatten : {False, True}, optional
        Whether to collapse nested fields.
    usemask : {False, True}, optional
        Whether to return a masked array or not.
    asrecarray : {False, True}, optional
        Whether to return a recarray (MaskedRecords) or not.

    Examples
    --------
    >>> from numpy.lib import recfunctions as rfn
    >>> rfn.merge_arrays((np.array([1, 2]), np.array([10., 20., 30.])))
    masked_array(data = [(1, 10.0) (2, 20.0) (--, 30.0)],
                 mask = [(False, False) (False, False) (True, False)],
           fill_value = (999999, 1e+20),
                dtype = [('f0', '<i4'), ('f1', '<f8')])

    >>> rfn.merge_arrays((np.array([1, 2]), np.array([10., 20., 30.])),
    ...              usemask=False)
    array([(1, 10.0), (2, 20.0), (-1, 30.0)],
          dtype=[('f0', '<i4'), ('f1', '<f8')])
    >>> rfn.merge_arrays((np.array([1, 2]).view([('a', int)]),
    ...               np.array([10., 20., 30.])),
    ...              usemask=False, asrecarray=True)
    rec.array([(1, 10.0), (2, 20.0), (-1, 30.0)],
              dtype=[('a', '<i4'), ('f1', '<f8')])

    Notes
    -----
    * Without a mask, the missing value will be filled with something,
    * depending on what its corresponding type:
            -1      for integers
            -1.0    for floating point numbers
            '-'     for characters
            '-1'    for strings
            True    for boolean values
    * XXX: I just obtained these values empirically
    iiR,R)Rttypecss|]}|jVqdS(N(tsize(t.0R-((s</usr/lib64/python2.7/site-packages/numpy/lib/recfunctions.pys	<genexpr>�stndmintcountRU(iN("RR*t
asanyarrayR4RR5RR.tTrueR#travelRRRRRNtmapRtmaxRARDt	__array__ROtgetmaskarrayt_check_fill_valuetitemtarraytonesRRRCRLtfromitertlist(R+RFR,RQRRtseqdtypetseqtypetsizest	maxlengthRtseqdatatseqmaskR-tnt	nbmissingRTRUtfvaltfmskR((s</usr/lib64/python2.7/site-packages/numpy/lib/recfunctions.pyR
Hs|1					
	 $!
$$cs�t|�r|g}nt|�}�fd���|j|�}|sOdStj|jd|�}t||�}t|d|d|�S(sb
    Return a new array with fields in `drop_names` dropped.

    Nested fields are supported.

    Parameters
    ----------
    base : array
        Input array
    drop_names : string or sequence
        String or sequence of strings corresponding to the names of the fields
        to drop.
    usemask : {False, True}, optional
        Whether to return a masked array or not.
    asrecarray : string or sequence
        Whether to return a recarray or a mrecarray (`asrecarray=True`) or
        a plain ndarray or masked array with flexible dtype (`asrecarray=False`)

    Examples
    --------
    >>> from numpy.lib import recfunctions as rfn
    >>> a = np.array([(1, (2, 3.0)), (4, (5, 6.0))],
    ...   dtype=[('a', int), ('b', [('ba', float), ('bb', int)])])
    >>> rfn.drop_fields(a, 'a')
    array([((2.0, 3),), ((5.0, 6),)],
          dtype=[('b', [('ba', '<f8'), ('bb', '<i4')])])
    >>> rfn.drop_fields(a, 'ba')
    array([(1, (3,)), (4, (6,))],
          dtype=[('a', '<i4'), ('b', [('bb', '<i4')])])
    >>> rfn.drop_fields(a, ['ba', 'bb'])
    array([(1,), (4,)],
          dtype=[('a', '<i4')])
    cs�|j}g}xt|D]l}||}||kr8qn|jro�||�}|r�|j||f�q�q|j||f�qW|S(N(RR(R&t
drop_namesRRR RR#(t_drop_descr(s</usr/lib64/python2.7/site-packages/numpy/lib/recfunctions.pyRx�s	

	RRQRRN(	RtsetRRR*temptytshapeRRS(tbaseRwRQRRRR((Rxs</usr/lib64/python2.7/site-packages/numpy/lib/recfunctions.pyR�s"cCst||dtdt�S(sK
    Returns a new numpy.recarray with fields in `drop_names` dropped.
    RQRR(RRMRa(R|Rw((s</usr/lib64/python2.7/site-packages/numpy/lib/recfunctions.pyRscs.�fd���|j|�}|j|�S(s�
    Rename the fields from a flexible-datatype ndarray or recarray.

    Nested fields are supported.

    Parameters
    ----------
    base : ndarray
        Input array whose fields must be modified.
    namemapper : dictionary
        Dictionary mapping old field names to their new version.

    Examples
    --------
    >>> from numpy.lib import recfunctions as rfn
    >>> a = np.array([(1, (2, [3.0, 30.])), (4, (5, [6.0, 60.]))],
    ...   dtype=[('a', int),('b', [('ba', float), ('bb', (float, 2))])])
    >>> rfn.rename_fields(a, {'a':'A', 'bb':'BB'})
    array([(1, (2.0, [3.0, 30.0])), (4, (5.0, [6.0, 60.0]))],
          dtype=[('A', '<i4'), ('b', [('ba', '<f8'), ('BB', '<f8', 2)])])

    csug}xh|jD]]}|j||�}||}|jrZ|j|�||�f�q|j||f�qW|S(N(RR0R(R&t
namemapperRR tnewnameR(t_recursive_rename_fields(s</usr/lib64/python2.7/site-packages/numpy/lib/recfunctions.pyR0s
		(RRN(R|R}R((Rs</usr/lib64/python2.7/site-packages/numpy/lib/recfunctions.pyRsc

Csvt|ttf�rEt|�t|�krid}t|��qin$t|t�ri|g}|g}n|dkr�g|D]!}tj|dt	dt
�^q|}gt||�D]'\}	}|j|	|j
fg�^q�}n�t|ttf�s|g}nt|�t|�krVt|�dkrA|t|�}qVd}t|��ngt|||�D]B\}}
}tj|dt	dt
d|�j|
|fg�^qi}t|d|d|�}t|�dkr�t|d	t
d|d|�}n|j�}tjtt|�t|��d|j
j|j
j�}t||�}t||�}t|d|d
|�S(s

    Add new fields to an existing array.

    The names of the fields are given with the `names` arguments,
    the corresponding values with the `data` arguments.
    If a single field is appended, `names`, `data` and `dtypes` do not have
    to be lists but just values.

    Parameters
    ----------
    base : array
        Input array to extend.
    names : string, sequence
        String or sequence of strings corresponding to the names
        of the new fields.
    data : array or sequence of arrays
        Array or sequence of arrays storing the fields to add to the base.
    dtypes : sequence of datatypes, optional
        Datatype or sequence of datatypes.
        If None, the datatypes are estimated from the `data`.
    fill_value : {float}, optional
        Filling value used to pad missing data on the shorter arrays.
    usemask : {False, True}, optional
        Whether to return a masked array or not.
    asrecarray : {False, True}, optional
        Whether to return a recarray (MaskedRecords) or not.

    s7The number of arrays does not match the number of namestcopytsubokis5The dtypes argument must be None, a dtype, or a list.RRQRFR,RRN(R4RRlRRR<RR*RiRMRatzipRNRR
R@ROt
masked_allRdR#RRS(
R|RRTtdtypesRFRQRRtmsgR-R RstdR((s</usr/lib64/python2.7/site-packages/numpy/lib/recfunctions.pyR?s:	.@X!cCs%t||d|d|dtdt�S(sM
    Add new fields to an existing array.

    The names of the fields are given with the `names` arguments,
    the corresponding values with the `data` arguments.
    If a single field is appended, `names`, `data` and `dtypes` do not have
    to be lists but just values.

    Parameters
    ----------
    base : array
        Input array to extend.
    names : string, sequence
        String or sequence of strings corresponding to the names
        of the new fields.
    data : array or sequence of arrays
        Array or sequence of arrays storing the fields to add to the base.
    dtypes : sequence of datatypes, optional
        Datatype or sequence of datatypes.
        If None, the datatypes are estimated from the `data`.

    See Also
    --------
    append_fields

    Returns
    -------
    appended_array : np.recarray
    RTR�RRRQ(RRaRM(R|RRTR�((s</usr/lib64/python2.7/site-packages/numpy/lib/recfunctions.pyR�scCst|t�r|St|�dkr-|dSg|D]}tj|�j�^q4}g|D]}t|�^q\}g|D]}|j^q{}g|D]}	|	j^q�}
|d}|j}g|D]}
|
d^q�}x|dD]}x�|jD]�}|dp
d}||kr6|j	|�|j	|�q�|j
|�}||}|r�tj|d�tj|d�kr�t|�}|d|d<t|�||<q�q�|d|dkr�t
dt|�||df��q�q�Wq�Wt|�dkrtj|�}n�tjtj|�f|�}tjtjd|f�}g}x�t||
|d |d�D]�\}}}}|jj}|d	kr�||dt|�||+qpx?|D]7}||||||+||kr�|j	|�q�q�WqpWtt||�d|d|�S(
s�
    Superposes arrays fields by fields

    Parameters
    ----------
    seqarrays : array or sequence
        Sequence of input arrays.
    defaults : dictionary, optional
        Dictionary mapping field names to the corresponding default values.
    usemask : {True, False}, optional
        Whether to return a MaskedArray (or MaskedRecords is `asrecarray==True`)
        or a ndarray.
    asrecarray : {False, True}, optional
        Whether to return a recarray (or MaskedRecords if `usemask==True`) or
        just a flexible-type ndarray.
    autoconvert : {False, True}, optional
        Whether automatically cast the type of the field to the maximum.

    Examples
    --------
    >>> from numpy.lib import recfunctions as rfn
    >>> x = np.array([1, 2,])
    >>> rfn.stack_arrays(x) is x
    True
    >>> z = np.array([('A', 1), ('B', 2)], dtype=[('A', '|S3'), ('B', float)])
    >>> zz = np.array([('a', 10., 100.), ('b', 20., 200.), ('c', 30., 300.)],
    ...   dtype=[('A', '|S3'), ('B', float), ('C', float)])
    >>> test = rfn.stack_arrays((z,zz))
    >>> test
    masked_array(data = [('A', 1.0, --) ('B', 2.0, --) ('a', 10.0, 100.0) ('b', 20.0, 200.0)
     ('c', 30.0, 300.0)],
                 mask = [(False, False, True) (False, False, True) (False, False, False)
     (False, False, False) (False, False, False)],
           fill_value = ('N/A', 1e+20, 1e+20),
                dtype = [('A', '|S3'), ('B', '<f8'), ('C', '<f8')])

    iiR)i����sIncompatible type '%s' <> '%s'sf%iRQRRN(R4RRR*R`RbRRR#RtindexRlRt	TypeErrortdictROtconcatenateR�tsumtcumsumtr_R�RRSRZ(tarraysRWRQRRtautoconvertR-R+tnrecordsR&R�tfldnamestdtype_ltnewdescrR(Rtdtype_nR#R tnameidxt
current_descrRtoffsettseenRstitj((s</usr/lib64/python2.7/site-packages/numpy/lib/recfunctions.pyR�sT'(
	

&)0
c
Cs
tj|�j�}t|j�}|}|r\x||D]}||}q;W||}n|j�}||}|j�}	|	d |	dk}
|r�|j}t|
|d<ntj	tg|
f�}
|
d |
d|
d*|||
}|r|||
fS|SdS(sa
    Find the duplicates in a structured array along a given key

    Parameters
    ----------
    a : array-like
        Input array
    key : {string, None}, optional
        Name of the fields along which to check the duplicates.
        If None, the search is performed by records
    ignoremask : {True, False}, optional
        Whether masked data should be discarded or considered as duplicates.
    return_index : {False, True}, optional
        Whether to return the indices of the duplicated values.

    Examples
    --------
    >>> from numpy.lib import recfunctions as rfn
    >>> ndtype = [('a', int)]
    >>> a = np.ma.array([1, 1, 1, 2, 2, 3, 3],
    ...         mask=[0, 0, 1, 0, 0, 0, 1]).view(ndtype)
    >>> rfn.find_duplicates(a, ignoremask=True, return_index=True)
    ... # XXX: judging by the output, the ignoremask flag has no effect
    i����iN(
R*R`RbRRtargsortRPt
recordmaskRMR�(
R-tkeyt
ignoremasktreturn_indexR$R|R9tsortidxt
sortedbaset
sorteddatatflagt
sortedmaskt
duplicates((s</usr/lib64/python2.7/site-packages/numpy/lib/recfunctions.pyRs(

	tinnert1t2c	*s!|dkrtd|��nt�t�r:�f�nxX�D]P}	|	|jjkrltd|	��n|	|jjkrAtd|	��qAqAW|j�}|j�}t|�t|�}
}|jj|jj}}
tjt|�t|
��j	��r2|p|r2d}|d7}t|��nt
|g|D]}|�kr?|^q?�}t
|g|
D]}|�krm|^qm�}tj||f�}|j
d	��}||}tjtg|d
|d kf�}|d
|d |d*||}|||
k}|||
k|
}t|�t|�}}|dkr]d\}}n�|dkr�||}tj||||
kf�}tj||||
k|
f�}t|�|t|�|}}nP|dkr*||}tj||||
kf�}t|�|d}}n||||}}g|jjD]}t|�^qL} | j�fd
�|jjD��td�| D��}!x�|jjD]�}"t|"�}"|"d}	|	|!krL| j|"�}#| |#}$|	�krt|"d
|$d�|$d<qj|$dc|7<|"dc|7<| j|#d
|"�q�|!j|"d�| j|"�q�Wg| D]}t|�^qu} t||�}%tj|%||fd| �}&|&jj}!x�|D]�}'||'}(|'|!ks
|'|
kr|r|'�kr|'|7}'n|&|'}$|(| |$|*|dkr�|(||$|%|%|+q�q�Wx�|
D]�}'||'}(|'|!ks�|'|kr�|r�|'�kr�|'|7}'n|&|'}$|(| |$|*|dkr^|r^|(||$|)q^q^W|&jd	��td|d|�})tt|&|�|)�S(s>
    Join arrays `r1` and `r2` on key `key`.

    The key should be either a string or a sequence of string corresponding
    to the fields used to join the array.
    An exception is raised if the `key` field cannot be found in the two input
    arrays.
    Neither `r1` nor `r2` should have any duplicates along `key`: the presence
    of duplicates will make the output quite unreliable. Note that duplicates
    are not looked for by the algorithm.

    Parameters
    ----------
    key : {string, sequence}
        A string or a sequence of strings corresponding to the fields used
        for comparison.
    r1, r2 : arrays
        Structured arrays.
    jointype : {'inner', 'outer', 'leftouter'}, optional
        If 'inner', returns the elements common to both r1 and r2.
        If 'outer', returns the common elements as well as the elements of r1
        not in r2 and the elements of not in r2.
        If 'leftouter', returns the common elements and the elements of r1 not
        in r2.
    r1postfix : string, optional
        String appended to the names of the fields of r1 that are present in r2
        but absent of the key.
    r2postfix : string, optional
        String appended to the names of the fields of r2 that are present in r1
        but absent of the key.
    defaults : {dictionary}, optional
        Dictionary mapping field names to the corresponding default values.
    usemask : {True, False}, optional
        Whether to return a MaskedArray (or MaskedRecords is `asrecarray==True`)
        or a ndarray.
    asrecarray : {False, True}, optional
        Whether to return a recarray (or MaskedRecords if `usemask==True`) or
        just a flexible-type ndarray.

    Notes
    -----
    * The output is sorted along the key.
    * A temporary array is formed by dropping the fields not in the key for the
      two arrays and concatenating the result. This array is then sorted, and
      the common entries selected. The output is constructed by filling the fields
      with the selected entries. Matching is not preserved if there are some
      duplicates...

    R�toutert	leftoutersWThe 'jointype' argument should be in 'inner', 'outer' or 'leftouter' (got '%s' instead)sr1 does not have key field %ssr2 does not have key field %ss8r1 and r2 contain common names, r1postfix and r2postfix scan't be emptytorderii����ic3s+|]!}|d�krt|�VqdS(iN(Rl(R]R((R�(s</usr/lib64/python2.7/site-packages/numpy/lib/recfunctions.pys	<genexpr>�scss|]}|dVqdS(iN((R]R(((s</usr/lib64/python2.7/site-packages/numpy/lib/recfunctions.pys	<genexpr>�sRRQRR(R�R�R�(ii(R�R�(RR4R<RRRbRRytintersectiont
differenceRROR�R�RMR*R#RlR!R�RdtinsertRRR�tsortR�RSRZ(*R�tr1tr2tjointypet	r1postfixt	r2postfixRWRQRRR tnb1tnb2tr1namestr2namesR�Rstr1ktr2ktauxtidx_sorttflag_intidx_intidx_1tidx_2tr1cmntr2cmntr1spctr2spctidx_outts1ts2R(R&RtdescR�RtcmnRR9tselectedtkwargs((R�s</usr/lib64/python2.7/site-packages/numpy/lib/recfunctions.pyR	:s�4

'

..
&
#$%#

 

+



+

c
Cs@td|d|d|d|dtdt�}t||||�S(s�
    Join arrays `r1` and `r2` on keys.
    Alternative to join_by, that always returns a np.recarray.

    See Also
    --------
    join_by : equivalent function
    R�R�R�RWRQRR(R�RMRaR	(R�R�R�R�R�R�RWR�((s</usr/lib64/python2.7/site-packages/numpy/lib/recfunctions.pyR
�s
()t__doc__tsysRAtnumpyR*tnumpy.maRORRRtnumpy.ma.mrecordsRtnumpy.lib._iotoolsRtcoreRgt__all__RRR"R%RMR.RRR6R=RaRLRSRZR
RRRRRRRR	R
(((s</usr/lib64/python2.7/site-packages/numpy/lib/recfunctions.pyt<module>sV			(			0	
	!�?		&E#	Z7	�