Ñò
*ÏÐKc           @   sá  d  Z  d d d g Z d d k Z d d k l Z d d k Z d d k Z d d k	 Z	 d d k
 Z
 e i Z h d d 6d	 d
 6d d 6d d 6d	 d 6d d 6d d 6d d 6d d 6d	 d	 6d d 6d d 6d d 6d d 6Z e i Z e i Z d „  Z d d  d „  ƒ  YZ d e i f d „  ƒ  YZ d e f d „  ƒ  YZ d d d d d e d d „ Z d d d d d e d d „ Z d d d d d d e d d „ Z d „  Z d d d d d d e d d „ Z d d d d d d d e d e d „
 Z d S(!   ss  
Record Arrays
=============
Record arrays expose the fields of structured arrays as properties.

Most commonly, ndarrays contain elements of a single type, e.g. floats, integers,
bools etc.  However, it is possible for elements to be combinations of these,
such as::

  >>> a = np.array([(1, 2.0), (1, 2.0)], dtype=[('x', int), ('y', float)])
  >>> a
  array([(1, 2.0), (1, 2.0)],
        dtype=[('x', '<i4'), ('y', '<f8')])

Here, each element consists of two fields: x (and int), and y (a float).
This is known as a structured array.  The different fields are analogous
to columns in a spread-sheet.  The different fields can be accessed as
one would a dictionary::

  >>> a['x']
  array([1, 1])

  >>> a['y']
  array([ 2.,  2.])

Record arrays allow us to access fields as properties::

  >>> ar = a.view(np.recarray)

  >>> ar.x
  array([1, 1])

  >>> ar.y
  array([ 2.,  2.])

t   recordt   recarrayt   format_parseriÿÿÿÿN(   t	   chararrayt   >t   bt   <t   lt   =t   nt   Bt   Lt   Nt   st   St   |t   It   ic         C   sj   g  } x] t  t |  ƒ ƒ D]I } |  | |  | d j o* |  | | j o | i |  | ƒ qb q q W| S(   s@   Find duplication in a list, return a list of duplicated elementsi   (   t   ranget   lent   append(   t   listt   dupR   (    (    sB   P:\graphics\Tools\Python26\lib\site-packages\numpy\core\records.pyt   find_duplicateH   s     c           B   s;   e  Z d  Z e d d „ Z d d „ Z d „  Z d „  Z RS(   s  
    Class to convert formats, names, titles description to a dtype.

    After constructing the format_parser object, the dtype attribute is
    the converted data-type:
    ``dtype = format_parser(formats, names, titles).dtype``

    Attributes
    ----------
    dtype : dtype
        The converted data-type.

    Parameters
    ----------
    formats : str or list of str
        The format description, either specified as a string with
        comma-separated format descriptions in the form ``'f8, i4, a5'``, or
        a list of format description strings  in the form
        ``['f8', 'i4', 'a5']``.
    names : str or list/tuple of str
        The field names, either specified as a comma-separated string in the
        form ``'col1, col2, col3'``, or as a list or tuple of strings in the
        form ``['col1', 'col2', 'col3']``.
        An empty list can be used, in that case default field names
        ('f0', 'f1', ...) are used.
    titles : sequence
        Sequence of title strings. An empty list can be used to leave titles
        out.
    aligned : bool, optional
        If True, align the fields by padding as the C-compiler would.
        Default is False.
    byteorder : str, optional
        If specified, all the fields will be changed to the
        provided byte-order.  Otherwise, the default byte-order is
        used. For all available string specifiers, see `dtype.newbyteorder`.

    See Also
    --------
    dtype, typename, sctype2char

    Examples
    --------
    >>> np.format_parser(['f8', 'i4', 'a5'], ['col1', 'col2', 'col3'],
    ...                  ['T1', 'T2', 'T3']).dtype
    dtype([(('T1', 'col1'), '<f8'), (('T2', 'col2'), '<i4'),
           (('T3', 'col3'), '|S5')]

    `names` and/or `titles` can be empty lists. If `titles` is an empty list,
    titles will simply not appear. If `names` is empty, default field names
    will be used.

    >>> np.format_parser(['f8', 'i4', 'a5'], ['col1', 'col2', 'col3'],
    ...                  []).dtype
    dtype([('col1', '<f8'), ('col2', '<i4'), ('col3', '|S5')])
    >>> np.format_parser(['f8', 'i4', 'a5'], [], []).dtype
    dtype([('f0', '<f8'), ('f1', '<i4'), ('f2', '|S5')])

    c         C   s=   |  i  | | ƒ |  i | | ƒ |  i | ƒ |  i |  _ d  S(   N(   t   _parseFormatst   _setfieldnamest   _createdescrt   _descrt   dtype(   t   selft   formatst   namest   titlest   alignedt	   byteorder(    (    sB   P:\graphics\Tools\Python26\lib\site-packages\numpy\core\records.pyt   __init__Œ   s    i    c   	      C   s%  | d j o t d ‚ n t | t ƒ o7 t | ƒ d j  o | i d ƒ n d i | ƒ } n t i | | ƒ } | i	 } | d j o( t i d | f g | ƒ } | i	 } n | i
 } g  } | D] } | | | d qÅ ~ |  _ g  } | D] } | | | d qñ ~ |  _ t | ƒ |  _ d S(	   s    Parse the field formats s   Need formats argumenti   t    t   ,t   f1i    i   N(   t   Nonet
   ValueErrort
   isinstanceR   R   R   t   joint   sbR   t   fieldsR   t
   _f_formatst   _offsetst   _nfields(	   R   R   R!   R   R,   t   keyst   _[1]t   keyt   _[2](    (    sB   P:\graphics\Tools\Python26\lib\site-packages\numpy\core\records.pyR   ’   s    		,,c   	      C   s•  | o t  | ƒ t i t i g j o n8 t  | ƒ t i j o | i d ƒ } n t d | ‚ g  } | |  i  D] } | | i ƒ  qs ~ |  _	 n
 g  |  _	 |  i	 g  } t
 t |  i	 ƒ |  i ƒ D] } | d | qÆ ~ 7_	 t |  i	 ƒ } | o t d | ‚ n | o5 g  } | |  i  D] } | | i ƒ  q"~ |  _ n g  |  _ g  } |  i t | ƒ j o' |  i d g |  i t | ƒ 7_ n d S(   sQ   convert input field names into a list and assign to the _names
        attribute R%   s   illegal input names %ss   f%ds   Duplicate field names: %sN(   t   typet   typest   ListTypet	   TupleTypet
   StringTypet   splitt	   NameErrorR/   t   stript   _namesR   R   R   R(   t   _titlesR'   (	   R   R   R    R1   R	   R3   R   t   _dupt   _[3](    (    sB   P:\graphics\Tools\Python26\lib\site-packages\numpy\core\records.pyR   ¥   s&    5	&5	c         C   sr   t  i h |  i d 6|  i d 6|  i d 6|  i d 6ƒ } | d  j	 o! t | d } | i | ƒ } n | |  _	 d  S(   NR   R   t   offsetsR    i    (
   R+   R   R<   R-   R.   R=   R'   t   _byteorderconvt   newbyteorderR   (   R   R"   t   descr(    (    sB   P:\graphics\Tools\Python26\lib\site-packages\numpy\core\records.pyR   É   s    

N(	   t   __name__t
   __module__t   __doc__t   FalseR'   R#   R   R   R   (    (    (    sB   P:\graphics\Tools\Python26\lib\site-packages\numpy\core\records.pyR   Q   s
   :	$c           B   s;   e  Z d  Z d „  Z d „  Z d „  Z d „  Z d „  Z RS(   sE   A data-type scalar that allows field access as attribute lookup.
    c         C   s
   |  i  ƒ  S(   N(   t   __str__(   R   (    (    sB   P:\graphics\Tools\Python26\lib\site-packages\numpy\core\records.pyt   __repr__×   s    c         C   s   t  |  i ƒ  ƒ S(   N(   t   strt   item(   R   (    (    sB   P:\graphics\Tools\Python26\lib\site-packages\numpy\core\records.pyRH   Ú   s    c      	   C   s  | d j o t  i i |  | ƒ Sy t  i i |  | ƒ SWn t j
 o n Xt  i i |  d ƒ i } | i | d  ƒ } | ou |  i | d  Œ  } y | i } Wn t j
 o | SX| i o | i	 | i
 ƒ S| i d j o | i	 t ƒ S| St d | ‚ d  S(   Nt   setfieldt   getfieldR   i   t   SUs%   'record' object has no attribute '%s'(   s   setfields   getfields   dtype(   t   ntt   voidt   __getattribute__t   AttributeErrorR,   t   getR'   RM   R   t   viewt	   __class__t   charR   (   R   t   attrt	   fielddictt   rest   objt   dt(    (    sB   P:\graphics\Tools\Python26\lib\site-packages\numpy\core\records.pyRQ   Ý   s*    
c         C   sŸ   | d j o t  d | ‚ n t i i |  d ƒ i } | i | d  ƒ } | o |  i | | d  Œ St |  | d  ƒ o t i i	 |  | | ƒ St  d | ‚ d  S(   NRL   RM   R   s   Cannot set '%s' attributei   s%   'record' object has no attribute '%s'(   s   setfields   getfields   dtype(
   RR   RO   RP   RQ   R,   RS   R'   RL   t   getattrt   __setattr__(   R   RW   t   valRX   RY   (    (    sB   P:\graphics\Tools\Python26\lib\site-packages\numpy\core\records.pyR]   ù   s    c      	   C   s‡   |  i  i } t g  } | D] } | t | ƒ q ~ ƒ } g  } d | } x. | D]& } | i | | t |  | ƒ f ƒ qP Wd i | ƒ S(   s   Pretty-print all fields.s   %% %ds: %%ss   
(   R   R   t   maxR   R   R\   R*   (   R   R   R1   t   namet   maxlent   rowst   fmt(    (    sB   P:\graphics\Tools\Python26\lib\site-packages\numpy\core\records.pyt   pprint  s    -
 $(   RD   RE   RF   RI   RH   RQ   R]   Rd   (    (    (    sB   P:\graphics\Tools\Python26\lib\site-packages\numpy\core\records.pyR    Ô   s   				c        
   B   sq   e  Z d  Z d	 d	 d d	 d	 d	 d	 d	 e d „	 Z d „  Z d „  Z d „  Z d „  Z	 d	 d „ Z
 d	 d	 d „ Z RS(
   sÔ  
    Construct an ndarray that allows field access using attributes.

    Arrays may have a data-types containing fields, analagous
    to columns in a spread sheet.  An example is ``[(x, int), (y, float)]``,
    where each entry in the array is a pair of ``(int, float)``.  Normally,
    these attributes are accessed using dictionary lookups such as ``arr['x']``
    and ``arr['y']``.  Record arrays allow the fields to be accessed as members
    of the array, using ``arr.x`` and ``arr.y``.

    Parameters
    ----------
    shape : tuple
        Shape of output array.
    dtype : data-type, optional
        The desired data-type.  By default, the data-type is determined
        from `formats`, `names`, `titles`, `aligned` and `byteorder`.
    formats : list of data-types, optional
        A list containing the data-types for the different columns, e.g.
        ``['i4', 'f8', 'i4']``.  `formats` does *not* support the new
        convention of using types directly, i.e. ``(int, float, int)``.
        Note that `formats` must be a list, not a tuple.
        Given that `formats` is somewhat limited, we recommend specifying
        `dtype` instead.
    names : tuple of str, optional
        The name of each column, e.g. ``('x', 'y', 'z')``.
    buf : buffer, optional
        By default, a new array is created of the given shape and data-type.
        If `buf` is specified and is an object exposing the buffer interface,
        the array will use the memory from the existing buffer.  In this case,
        the `offset` and `strides` keywords are available.

    Other Parameters
    ----------------
    titles : tuple of str, optional
        Aliases for column names.  For example, if `names` were
        ``('x', 'y', 'z')`` and `titles` is
        ``('x_coordinate', 'y_coordinate', 'z_coordinate')``, then
        ``arr['x']`` is equivalent to both ``arr.x`` and ``arr.x_coordinate``.
    byteorder : {'<', '>', '='}, optional
        Byte-order for all fields.
    aligned : bool, optional
        Align the fields in memory as the C-compiler would.
    strides : tuple of ints, optional
        Buffer (`buf`) is interpreted according to these strides (strides
        define how many bytes each array element, row, column, etc.
        occupy in memory).
    offset : int, optional
        Start reading buffer (`buf`) from this offset onwards.

    Returns
    -------
    rec : recarray
        Empty array of the given shape and type.

    See Also
    --------
    rec.fromrecords : Construct a record array from data.
    record : fundamental data-type for `recarray`.
    format_parser : determine a data-type from formats, names, titles.

    Notes
    -----
    This constructor can be compared to ``empty``: it creates a new record
    array but does not fill it with data.  To create a reccord array from data,
    use one of the following methods:

    1. Create a standard ndarray and convert it to a record array,
       using ``arr.view(np.recarray)``
    2. Use the `buf` keyword.
    3. Use `np.rec.fromrecords`.

    Examples
    --------
    Create an array with two fields, ``x`` and ``y``:

    >>> x = np.array([(1.0, 2), (3.0, 4)], dtype=[('x', float), ('y', int)])
    >>> x
    array([(1.0, 2), (3.0, 4)],
          dtype=[('x', '<f8'), ('y', '<i4')])

    >>> x['x']
    array([ 1.,  3.])

    View the array as a record array:

    >>> x = x.view(np.recarray)

    >>> x.x
    array([ 1.,  3.])

    >>> x.y
    array([2, 4])

    Create a new, empty record array:

    >>> np.recarray((2,),
    ... dtype=[('x', int), ('y', float), ('z', int)]) #doctest: +SKIP
    rec.array([(-1073741821, 1.2249118382103472e-301, 24547520),
           (3471280, 1.2134086255804012e-316, 0)],
          dtype=[('x', '<i4'), ('y', '<f8'), ('z', '<i4')])

    i    c      
   C   s˜   | d  j	 o t i | ƒ } n t | | | |
 |	 ƒ i } | d  j o t i |  | t | f ƒ } n. t i |  | t | f d | d | d | ƒ} | S(   Nt   buffert   offsett   strides(   R'   R+   R   R   R   t   ndarrayt   __new__R    (   t   subtypet   shapeR   t   bufRf   Rg   R   R   R    R"   R!   RC   R   (    (    sB   P:\graphics\Tools\Python26\lib\site-packages\numpy\core\records.pyRi   ‚  s    	c      	   C   sÉ   y t  i |  | ƒ SWn t j
 o n Xt i |  d ƒ i } y | | d  } Wn& t t f j
 o t d | ‚ n X|  i | Œ  } | i i o | S| i i	 d j o | i
 t ƒ S| i
 t ƒ S(   NR   i   s    record array has no attribute %sRN   (   t   objectRQ   RR   Rh   R,   t	   TypeErrort   KeyErrorRM   R   RV   RT   R   (   R   RW   RX   RY   RZ   (    (    sB   P:\graphics\Tools\Python26\lib\site-packages\numpy\core\records.pyRQ   “  s    c   	      C   s!  | |  i  j } y t i |  | | ƒ } WnS t i |  d ƒ i p h  } | | j o# t i ƒ  d  \ } } | | ‚ qÖ nY Xt i |  d ƒ i p h  } | | j o | S| o# y t i |  | ƒ WqÖ | SXn y | | d  } Wn& t	 t
 f j
 o t d | ‚ n X|  i | | Œ S(   NR   i   s    record array has no attribute %s(   t   __dict__Rm   R]   Rh   RQ   R,   t   syst   exc_infot   __delattr__Rn   Ro   RR   RL   (	   R   RW   R^   t   newattrt   retRX   t   exctypet   valueRY   (    (    sB   P:\graphics\Tools\Python26\lib\site-packages\numpy\core\records.pyR]   «  s*    	c         C   sA   t  i |  | ƒ } t | t  ƒ o | i i o | i t  ƒ S| S(   N(   Rh   t   __getitem__R)   R   t	   isbuiltinRT   (   R   t   indxRZ   (    (    sB   P:\graphics\Tools\Python26\lib\site-packages\numpy\core\records.pyRx   Ä  s    c         C   s"   t  i |  ƒ } | i d d d ƒ S(   NR   s	   rec.arrayi   (   Rh   RI   t   replace(   R   Ru   (    (    sB   P:\graphics\Tools\Python26\lib\site-packages\numpy\core\records.pyRI   Ê  s    c         C   sÇ   t  | t ƒ o# t i |  d ƒ i } | | } n t i |  d ƒ i } | | d  } | d  j oP |  i | Œ  } | i i o | S| i i	 d j o | i
 t ƒ S| i
 t ƒ S|  i | | Œ Sd  S(   NR   i   RN   (   R)   t   intRh   RQ   R   R,   R'   RM   R   RV   RT   R   RL   (   R   RW   R^   R   RX   RY   RZ   (    (    sB   P:\graphics\Tools\Python26\lib\site-packages\numpy\core\records.pyt   fieldÎ  s    c         C   sÁ   | d  j o t i |  | ƒ S| d  j o y% t | t ƒ o t i |  | ƒ SWn t j
 o n Xt i | ƒ } | i d  j o |  i ƒ  i | ƒ St i |  | ƒ St i |  | | ƒ Sd  S(   N(	   R'   Rh   RT   t
   issubclassRn   R+   R   R,   t	   __array__(   R   R   R4   (    (    sB   P:\graphics\Tools\Python26\lib\site-packages\numpy\core\records.pyRT   á  s    N(   RD   RE   RF   R'   RG   Ri   RQ   R]   Rx   RI   R}   RT   (    (    (    sB   P:\graphics\Tools\Python26\lib\site-packages\numpy\core\records.pyR     s   g					c         C   so  g  } |  D] }	 | t  i |	 ƒ q ~ }  | d j p | d j o |  d i } n t | t ƒ o | f } n | d j o˜ | d j o‹ d } xt |  D]l }
 t |
 t ƒ p t d ‚ n | t |
 i	 i
 7} t |
 i	 i
 t i ƒ o | |
 i 7} n | d 7} q™ W| d  } n | d j	 o t  i	 | ƒ } | i } n+ t | | | | | ƒ } | i } | i } t | ƒ t |  ƒ j o t d ‚ n | d i } t | ƒ } | d j o | |  } n xe t |  ƒ D]W \ } }
 t | | i ƒ } |
 i t |
 i ƒ |  } | | j o t d | ‚ qÒqÒWt | | ƒ } x, t t |  ƒ ƒ D] } |  | | | | <qOW| S(	   s@   create a record array from a (flat) list of arrays

    >>> x1=np.array([1,2,3,4])
    >>> x2=np.array(['a','dd','xyz','12'])
    >>> x3=np.array([1.1,2,3,4])
    >>> r = np.core.records.fromarrays([x1,x2,x3],names='a,b,c')
    >>> print r[1]
    (2, 'dd', 2.0)
    >>> x1[1]=34
    >>> r.a
    array([1, 2, 3, 4])
    i    R$   s*   item in the array list must be an ndarray.R%   iÿÿÿÿs>   mismatch between the number of fields and the number of arrayss    array-shape mismatch in array %dN(   R+   t   asarrayR'   Rk   R)   R|   Rh   R(   t   _typestrR   R4   R~   RO   t   flexiblet   itemsizeR   R   R<   R   R   t	   enumerateR   R   (   t	   arrayListR   Rk   R   R   R    R!   R"   R1   t   xRZ   RC   R<   t   parsedt   d0t   nnt   kt	   testshapet   _arrayR   (    (    sB   P:\graphics\Tools\Python26\lib\site-packages\numpy\core\records.pyt
   fromarraysò  sN    * 		  c         C   s  t  |  d ƒ } | d j o‘ | d j o„ t i |  d t ƒ}	 g  }
 t | ƒ D]& } |
 t i |	 d | f i ƒ  ƒ qP ~
 } t | d | d | d | d | d | d	 | ƒS| d j	 o t i t	 | f ƒ } n t
 | | | | | ƒ i } y t i |  d | ƒ} Wn¾ t j
 o² | d j p | d j o t  |  ƒ } n t | t t f ƒ o | f } n t  | ƒ d
 j o t d ‚ n t | | ƒ } x+ t | i ƒ D] } t |  | ƒ | | <q¥W| SX| d j	 o | i | j o | | _ n | i t ƒ } | S(   si   create a recarray from a list of records in text form

        The data in the same field can be heterogeneous, they will be promoted
        to the highest data type.  This method is intended for creating
        smaller record arrays.  If used to create large array without formats
        defined

        r=fromrecords([(2,3.,'abc')]*100000)

        it can be slow.

        If formats is None, then this will auto-detect formats. Use list of
        tuples rather than list of lists for faster processing.

    >>> r=np.core.records.fromrecords([(456,'dbe',1.2),(2,'de',1.3)],
    ... names='col1,col2,col3')
    >>> print r[0]
    (456, 'dbe', 1.2)
    >>> r.col1
    array([456,   2])
    >>> r.col2
    chararray(['dbe', 'de'],
          dtype='|S3')
    >>> import cPickle
    >>> print cPickle.loads(cPickle.dumps(r))
    [(456, 'dbe', 1.2) (2, 'de', 1.3)]
    i    R   .R   Rk   R   R    R!   R"   i   s   Can only deal with 1-d array.N(   R   R'   R+   t   arrayRm   t   xranget   tolistR   R   R    R   R   Rn   R)   R|   t   longR(   R   t   sizet   tupleRk   RT   (   t   recListR   Rk   R   R   R    R!   R"   t   nfieldsRZ   R1   R   t   arrlistRC   t   retvalRŒ   RŠ   RY   (    (    sB   P:\graphics\Tools\Python26\lib\site-packages\numpy\core\records.pyt   fromrecords7  s6    @ i    c	         C   sÉ   | d j o | d j o t d ‚ n | d j	 o t i | ƒ }	 n t | | | | | ƒ i }	 |	 i }
 | d j p | d j p | d j o t |  ƒ | |
 } n t | |	 d |  d | ƒ} | S(   sM    create a (read-only) record array from binary data contained in
    a strings   Must have dtype= or formats=i    iÿÿÿÿRl   Rf   N(	   R'   R(   R+   R   R   R   Rƒ   R   R   (   t
   datastringR   Rk   Rf   R   R   R    R!   R"   RC   Rƒ   RŒ   (    (    sB   P:\graphics\Tools\Python26\lib\site-packages\numpy\core\records.pyt
   fromstringw  s    	'c         C   sf   y |  i  ƒ  } Wn- t j
 o! t i i |  i ƒ |  i ƒ  SXt i | ƒ } | i |  i ƒ  } | S(   N(	   t   filenoRR   t   ost   patht   getsizeR`   t   tellt   fstatt   st_size(   t   fdt   fnt   stR’   (    (    sB   P:\graphics\Tools\Python26\lib\site-packages\numpy\core\records.pyt   get_remaining_sizeŒ  s    c	         C   sÚ  | d j p | d j o
 d } n$ t | t t f ƒ o | f } n d }	 t |  t ƒ o d }	 t |  d ƒ }  n | d j o |  i | d ƒ n t |  ƒ }
 | d j	 o t i	 | ƒ } n t
 | | | | | ƒ i } | i } t i | ƒ i ƒ  } | | } | d j  oI t | ƒ } |
 | | | i d ƒ <t | ƒ } t i | ƒ i ƒ  } n | | } | |
 j o t d ƒ ‚ n t | | ƒ } |  i | i ƒ } | | j o t d ƒ ‚ n |	 o |  i ƒ  n | S(	   s  Create an array from binary file data

    If file is a string then that file is opened, else it is assumed
    to be a file object.

    >>> from tempfile import TemporaryFile
    >>> a = np.empty(10,dtype='f8,i4,a5')
    >>> a[5] = (0.5,10,'abcde')
    >>>
    >>> fd=TemporaryFile()
    >>> a = a.newbyteorder('<')
    >>> a.tofile(fd)
    >>>
    >>> fd.seek(0)
    >>> r=np.core.records.fromfile(fd, formats='f8,i4,a5', shape=10,
    ... byteorder='<')
    >>> print r[5]
    (0.5, 10, 'abcde')
    >>> r.shape
    (10,)
    i    iÿÿÿÿi   t   rbs:   Not enough bytes left in file for specified shape and types%   Didn't read as many bytes as expectedN(   iÿÿÿÿ(   R'   R)   R|   R‘   RJ   t   opent   seekR¥   R+   R   R   R   Rƒ   RŽ   t   prodR   t   indexR“   R(   R   t   readintot   datat   IOErrort   close(   R¢   R   Rk   Rf   R   R   R    R!   R"   R`   R’   RC   Rƒ   t	   shapeprodt	   shapesizet   nbytesRŒ   t
   nbytesread(    (    sB   P:\graphics\Tools\Python26\lib\site-packages\numpy\core\records.pyt   fromfile•  sB    
	

c      	   C   s¨  t  |  t d ƒ t t f ƒ o* | d j o | d j o t d ƒ ‚ n h  } | d j	 o t i | ƒ } nV | d j	 o t | | | | |	 ƒ i	 } n* h | d 6| d 6| d 6| d 6|	 d 6} |  d j o= | d j o t d ƒ ‚ n t
 | | d |  d	 | d
 | ƒSt  |  t ƒ o t |  | d | d	 | | St  |  t t f ƒ oQ t  |  d t t f ƒ o t |  d | d | | St |  d | d | | Snt  |  t
 ƒ oR | d j	 o# |  i | j o |  i | ƒ } n |  } |
 o | i ƒ  } n | St  |  t ƒ o t |  d | d | d	 | ƒSt  |  t ƒ o™ | d j	 o# |  i | j o |  i | ƒ } n |  } |
 o | i ƒ  } n | i t
 ƒ } t | i i t i ƒ o t i t | i f ƒ | _ n | St |  d d ƒ } | d j p t  | t ƒ o t d ƒ ‚ n t i |  ƒ }  | d j	 o# |  i | j o |  i | ƒ }  n |  i t
 ƒ } t | i i t i ƒ o t i t | i f ƒ | _ n | Sd S(   s=   Construct a record array from a wide-variety of objects.
    sI   Must define formats (or dtype) if object is None, string, or an open fileR   R   R    R!   R"   s"   Must define a shape if obj is NoneRl   Rf   Rg   Rk   i    R   t   __array_interface__s   Unknown input typeN(   R)   R4   R'   RJ   t   fileR(   R+   R   R   R   R   Rš   R   R“   R˜   R   RT   t   copyR³   Rh   R~   RO   RP   R    R\   t   dictRŽ   (   RZ   R   Rk   Rf   Rg   R   R   R    R!   R"   R¶   t   kwdst   newRY   t	   interface(    (    sB   P:\graphics\Tools\Python26\lib\site-packages\numpy\core\records.pyRŽ   Ù  sj    ,

 (    (   RF   t   __all__t   numericR+   t   defchararrayR   t   numerictypesRO   R5   Rœ   Rq   Rh   RA   t   typeDictt   numfmtR   R   R   RP   R    R   R'   RG   R   R˜   Rš   R¥   R³   t   TrueRŽ   (    (    (    sB   P:\graphics\Tools\Python26\lib\site-packages\numpy\core\records.pyt   <module>$   sN   	

				ƒFØ	D?		C