OwlCyberSecurity - MANAGER
Edit File: mrecords.cpython-38.pyc
U �p�] i � @ sH d Z ddlmZmZmZ ddlZddlZddlZddl m Z ddlmZmZm Z mZmZ ddlmZmZ ejjjZddlmZ ddlmZmZmZmZmZm Z m!Z!m"Z" ejj#Z#dd d ddd gZ$ddddgZ%d$dd�Z&dd� Z'G dd� dee(�Z)dd� Z*e)Z+d%dd �Zddddddddef dd�Zdd� Z,dd� Z-d&d"d�Z.d'd#d �Z/dS )(a, :mod:`numpy.ma..mrecords` Defines the equivalent of :class:`numpy.recarrays` for masked arrays, where fields can be accessed as attributes. Note that :class:`numpy.ma.MaskedArray` already supports structured datatypes and the masking of individual fields. .. moduleauthor:: Pierre Gerard-Marchant � )�division�absolute_import�print_functionN)� basestring)�bool_�dtype�ndarray�recarray�array)� fromarrays�fromrecords)�MAError�MaskedArray�masked�nomask�masked_array�getdata�getmaskarray�filled� MaskedRecords� mrecarrayr r �fromtextfile�addfield�_data�_mask� _fieldmaskr c C s� t | �}dd� t|�D �}|dkr(|}nZt|ttf�r<|}n&t|t�rR|�d�}ntdt|� ��t |�}||k r�|||d� 7 }g }t ||| j �D ]P\}}}|tkr�|d tkr�|�||d f� q�|�|� q�|�||d f� q�t �|�S )z� Checks that field names ``descr`` are not reserved keywords. If this is the case, a default 'f%i' is substituted. If the argument `names` is not None, updates the field names to valid names. c S s g | ]}d | �qS )�f%i� ��.0�ir r �3/usr/lib/python3/dist-packages/numpy/ma/mrecords.py� <listcomp>: s z_checknames.<locals>.<listcomp>N�,zillegal input names %sr � )�len�range� isinstance�tuple�list�str�split� NameError�repr�zip�descr�reserved_fields�append�npr ) r/ �namesZndescrZ default_namesZ new_namesZnnames�n�d�tr r r! �_checknames1 s( r7 c C s: dd� | j jD �}tj| j|d�}tdgt|� �|_|S )Nc S s g | ]}|d f�qS )z|b1r �r r4 r r r! r"