This repository has been archived by the owner on May 6, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 40
/
Copy pathmaskedarray.baseclass.html
31 lines (29 loc) · 4.11 KB
/
maskedarray.baseclass.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<span id="numpy-ma-constants"></span><h1><span class="yiyi-st" id="yiyi-33">Constants of the <code class="xref py py-mod docutils literal"><span class="pre">numpy.ma</span></code> module</span></h1>
<blockquote>
<p>原文:<a href="https://docs.scipy.org/doc/numpy/reference/maskedarray.baseclass.html">https://docs.scipy.org/doc/numpy/reference/maskedarray.baseclass.html</a></p>
<p>译者:<a href="https://github.com/wizardforcel">飞龙</a> <a href="http://usyiyi.cn/">UsyiyiCN</a></p>
<p>校对:(虚位以待)</p>
</blockquote>
<p><span class="yiyi-st" id="yiyi-34">除了<a class="reference internal" href="#numpy.ma.MaskedArray" title="numpy.ma.MaskedArray"><code class="xref py py-class docutils literal"><span class="pre">MaskedArray</span></code></a>类,<code class="xref py py-mod docutils literal"><span class="pre">numpy.ma</span></code>模块定义了几个常量。</span></p>
<dl class="data">
<dt id="numpy.ma.masked"><span class="yiyi-st" id="yiyi-35"> <code class="descclassname">numpy.ma.</code><code class="descname">masked</code></span></dt>
<dd><p><span class="yiyi-st" id="yiyi-36"><a class="reference internal" href="#numpy.ma.masked" title="numpy.ma.masked"><code class="xref py py-attr docutils literal"><span class="pre">masked</span></code></a>常量是<a class="reference internal" href="#numpy.ma.MaskedArray" title="numpy.ma.MaskedArray"><code class="xref py py-class docutils literal"><span class="pre">MaskedArray</span></code></a>的特殊情况,具有float数据类型和null形状。</span><span class="yiyi-st" id="yiyi-37">它用于测试被屏蔽数组的特定条目是否被屏蔽,或者屏蔽被屏蔽数组的一个或多个条目:</span></p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="n">x</span> <span class="o">=</span> <span class="n">ma</span><span class="o">.</span><span class="n">array</span><span class="p">([</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">],</span> <span class="n">mask</span><span class="o">=</span><span class="p">[</span><span class="mi">0</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">])</span>
<span class="gp">>>> </span><span class="n">x</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span> <span class="ow">is</span> <span class="n">ma</span><span class="o">.</span><span class="n">masked</span>
<span class="go">True</span>
<span class="gp">>>> </span><span class="n">x</span><span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span> <span class="o">=</span> <span class="n">ma</span><span class="o">.</span><span class="n">masked</span>
<span class="gp">>>> </span><span class="n">x</span>
<span class="go">masked_array(data = [1 -- --],</span>
<span class="go"> mask = [False True True],</span>
<span class="go"> fill_value = 999999)</span>
</pre></div>
</div>
</dd></dl>
<dl class="data">
<dt id="numpy.ma.nomask"><span class="yiyi-st" id="yiyi-38"> <code class="descclassname">numpy.ma.</code><code class="descname">nomask</code></span></dt>
<dd><p><span class="yiyi-st" id="yiyi-39">指示掩码数组没有无效条目的值。</span><span class="yiyi-st" id="yiyi-40"><a class="reference internal" href="#numpy.ma.nomask" title="numpy.ma.nomask"><code class="xref py py-attr docutils literal"><span class="pre">nomask</span></code></a>在内部用于在不需要掩码时加快计算速度。</span></p>
</dd></dl>
<dl class="data">
<dt id="numpy.ma.masked_print_options"><span class="yiyi-st" id="yiyi-41"> <code class="descclassname">numpy.ma.</code><code class="descname">masked_print_options</code></span></dt>
<dd><p><span class="yiyi-st" id="yiyi-42">打印掩码数组时用于替换缺少数据的字符串。</span><span class="yiyi-st" id="yiyi-43">默认情况下,此字符串为<code class="docutils literal"><span class="pre">'--'</span></code>。</span></p>
</dd></dl>