| Server IP : 209.209.40.120 / Your IP : 216.73.217.112 Web Server : Microsoft-IIS/10.0 System : Windows NT NEWWWW 10.0 build 17763 (Windows Server 2019) i586 User : NEWWWW$ ( 0) PHP Version : 8.3.30 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /Python312/Lib/site-packages/numpy/lib/__pycache__/ |
Upload File : |
�
�g�� � �j � d Z ddlZddlZddlmZ ddlmc mZ ddl m
Z
ddlmZ g d�Z
d� Z e
e� d� � Zd� Zd � Zd
� Zd� Zd7d�Zd7d
�Zd8d�Zd� Zd� Zd9d�Zd:d�Zd;d�Z d<d�Z e
e� d=d�� Zd8d�Z e
e� d:d�� Zd:d�Z d� Z! e
e!� d� � Z"d� Z# e
e#� d� � Z$ d<d�Z% e
e%� d>d�� Z&d;d�Z' e
e'� d;d �� Z(d8d!�Z) e
e)� d?d"�� Z*d@d#�Z+d$� Z, dAd%�Z- e
e-� dBd&�� Z. dCd'�Z/ e
e/� dDd(�� Z0d)� Z1 e
e1� d*� � Z2d;d+�Z3 e
e3� dEd,�� Z4d-� Z5 e
e5� d.� � Z6 d<d/�Z7 e
e7� dFd0�� Z8 dAd1�Z9 e
e9� dGd2�� Z: dHd3�Z; e
e;� dId4�� Z< d<d5�Z= e
e=� dJd6�� Z>[
y)Kz�
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.
� N)�array_function_dispatch)�_is_string_like)�
append_fields�apply_along_fields�assign_fields_by_name�drop_fields�find_duplicates�
flatten_descr�get_fieldstructure� get_names�get_names_flat�join_by�merge_arrays�rec_append_fields�rec_drop_fields�rec_join�recursive_fill_fields�
rename_fields�
repack_fields�require_fields�stack_arrays�structured_to_unstructured�unstructured_to_structuredc �
� | |fS �N� )�input�outputs �8C:\Python312\Lib\site-packages\numpy/lib/recfunctions.py�!_recursive_fill_fields_dispatcherr s � ��6�?�� c �� � |j }|j D ]? } | | }|j j �t ||| � �/||| dt |� �A |S # t $ r Y �Ow xY w)a�
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
--------
>>> import numpy as np
>>> from numpy.lib import recfunctions as rfn
>>> a = np.array([(1, 10.), (2, 20.)], dtype=[('A', np.int64), ('B', np.float64)])
>>> b = np.zeros((3,), dtype=a.dtype)
>>> rfn.recursive_fill_fields(a, b)
array([(1, 10.), (2, 20.), (0, 0.)], dtype=[('A', '<i8'), ('B', '<f8')])
N)�dtype�names�
ValueErrorr �len)r r �newdtype�field�currents r r r s} � �6 �|�|�H���� 3�� ��E�l�G� �=�=���*�!�'�6�%�=�9�+2�F�5�M�-�3�w�<�(�3� �M��
� �� �s �A� A)�(A)c � � � � j �d� fgS � fd�� j D � }|D ��cg c]! \ }}t |� dk( r|n|d |f|d f��# c}}S c c}}w )am
Produce a list of name/dtype pairs corresponding to the dtype fields
Similar to dtype.descr, but the second item of each tuple is a dtype, not a
string. As a result, this handles subarray dtypes
Can be passed to the dtype constructor to reconstruct the dtype, noting that
this (deliberately) discards field offsets.
Examples
--------
>>> import numpy as np
>>> dt = np.dtype([(('a', 'A'), np.int64), ('b', np.double, 3)])
>>> dt.descr
[(('a', 'A'), '<i8'), ('b', '<f8', (3,))]
>>> _get_fieldspec(dt)
[(('a', 'A'), dtype('int64')), ('b', dtype(('<f8', (3,))))]
� c 3 �@ �K � | ] }|�j | f�� � y �wr )�fields��.0�namer# s �r � <genexpr>z!_get_fieldspec.<locals>.<genexpr>` s �� �� �E��4����d�+�,�E�s �� r )r$ r&