관리-도구
편집 파일: extras.cpython-37.pyc
B ��Fd�� � , @ s� d Z ddlmZmZmZ ddddddd d ddd ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.g,Zdd/lZdd/lZd0d1lm Z d0d2l mZmZm Z mZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZm Z dd/l!Z"dd3l!m#Z#mZ$ dd/l%m m&Z& dd4l'm(Z( dd5l)m*Z* dd6l+m,Z, dd7l-m.Z. d8d9� Z/dsd:d�Z0e1fd;d!�Z2d<d"� Z3G d=d>� d>�Z4G d?d@� d@e4�Z5G dAdB� dBe4�Z6G dCdD� dDe4�Z7G dEdF� dFe4�Z8e8d�Z9e8d�Z:e8d�Z;e6d.� Z<Z=e6d�Z>e6d�Z?e6d�Z@e5d�ZAe5d�ZBdGdH� ZCdId� ZDe"jDj eD_ dJd� ZEeEj d/k �r\e"jEj d/e"jEj �FdK�� �G� dL eE_ dtdNd�ZHdudOd#�ZIdvdPdQ�ZJdwdRd �ZKdxdSd�ZLdTd� ZMdUd� ZNdydVd �ZOdzdWd�ZPd{dXd�ZQd|dYd+�ZRd}dZd�ZSd~d[d*�ZTdd\d�ZUd�d]d�ZVd^d,� ZWd�d_d)�ZXd�dadb�ZYd�dcd�ZZd/d`e"j[d`e"j[fddd�Z\G dedf� dfe.�Z]G dgdh� dhe]�Z^e^� Z_did� Z`d�djd&�Zadkd� Zbd�dld%�Zcdmdn� Zddod � Zedpd � Zfd�dqd-�Zge �he"jgj egj �eg_ d�drd'�Zie �he"jij eij �ei_ d/S )�z� Masked arrays add-ons. A collection of utilities for `numpy.ma`. :author: Pierre Gerard-Marchant :contact: pierregm_at_uga_dot_edu :version: $Id: extras.py 3473 2007-10-29 15:18:13Z jarrod.millman $ � )�division�absolute_import�print_function�apply_along_axis�apply_over_axes� atleast_1d� atleast_2d� atleast_3d�average�clump_masked�clump_unmasked�column_stack� compress_cols�compress_nd�compress_rowcols� compress_rows�count_masked�corrcoef�cov�diagflat�dot�dstack�ediff1d�flatnotmasked_contiguous�flatnotmasked_edges�hsplit�hstack�isin�in1d�intersect1d� mask_cols�mask_rowcols� mask_rows� masked_all�masked_all_like�median�mr_�notmasked_contiguous�notmasked_edges�polyfit� row_stack� setdiff1d�setxor1d�unique�union1d�vander�vstackN� )�core)�MaskedArray�MAError�add�array�asarray�concatenate�filled�count�getmask�getmaskarray�make_mask_descr�masked�masked_array�mask_or�nomask�ones�sort�zeros�getdata�get_masked_subclassr r! )�ndarrayr6 )�normalize_axis_index)�normalize_axis_tuple)�_ureduce)�AxisConcatenatorc C s t | tttf�S )z6 Is seq a sequence (ndarray, list or tuple)? )� isinstancerG �tuple�list)�seq� rP �B/opt/alt/python37/lib64/python3.7/site-packages/numpy/ma/extras.py� issequence- s rR c C s t | �}|�|�S )a� Count the number of masked elements along the given axis. Parameters ---------- arr : array_like An array with (possibly) masked elements. axis : int, optional Axis along which to count. If None (default), a flattened version of the array is used. Returns ------- count : int, ndarray The total number of masked elements (axis=None) or the number of masked elements along each slice of the given axis. See Also -------- MaskedArray.count : Count non-masked elements. Examples -------- >>> import numpy.ma as ma >>> a = np.arange(9).reshape((3,3)) >>> a = ma.array(a) >>> a[1, 0] = ma.masked >>> a[1, 2] = ma.masked >>> a[2, 1] = ma.masked >>> a masked_array(data = [[0 1 2] [-- 4 --] [6 -- 8]], mask = [[False False False] [ True False True] [False True False]], fill_value=999999) >>> ma.count_masked(a) 3 When the `axis` keyword is used an array is returned. >>> ma.count_masked(a, axis=0) array([1, 1, 1]) >>> ma.count_masked(a, axis=1) array([0, 2, 1]) )r<