Файловый менеджер - Редактировать - /home/digitalm/venv/lib/python3.7/site-packages/numpy/ma/__pycache__/mrecords.cpython-37.pyc
Назад
B �5�g>h � @ s d Z ddlmZmZmZmZmZmZmZm Z ddlm Z ddlZddlZ ddlmZmZmZmZmZ ddlmZmZ e jjjZe jjZdddd d dgZdd ddgZd"dd�Zdd� Z G dd� de�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 � )�MAError�MaskedArray�masked�nomask�masked_array�getdata�getmaskarray�filledN)�bool_�dtype�ndarray�recarray�array)� fromarrays�fromrecords� MaskedRecords� mrecarrayr r �fromtextfile�addfield�_data�_mask� _fieldmaskr c C s� t | �}dd� t|�D �}|dkr(|}nXt|ttf�r<|}n$t|t�rR|�d�}ntd|����t |�}||k r�|||d� 7 }g }xbt||| j �D ]P\}}}|t kr�|d t kr�|�||d f� q�|�|� q�|�||d f� q�W 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 )zf%i� )�.0�ir r �G/home/digitalm-up/venv/lib/python3.7/site-packages/numpy/ma/mrecords.py� <listcomp>6 s z_checknames.<locals>.<listcomp>N�,zillegal input names r � )�len�range� isinstance�tuple�list�str�split� NameError�zip�descr�reserved_fields�append�npr ) r( �namesZndescr� default_namesZ new_namesZnnames�n�d�tr r r �_checknames- s( r1 c C s: dd� | j jD �}tj| j|d�}tdgt|� �|_|S )Nc S s g | ]}|d f�qS )z|b1r )r r. r r r r P s z"_get_fieldmask.<locals>.<listcomp>)r F)r r, r+ �empty�shaper"