⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 109.html

📁 国外python经典教材,python爱好者的首选
💻 HTML
📖 第 1 页 / 共 3 页
字号:
<FONT size="2">
<p><i><tt class="monofont">a</tt></i>
<tt clAss="monofont">.pop([</Tt><i><tT clasS="monofont">i</tt></i>
<TT CLass="monofont">])</tT></P>
</FOnt></td>
<TD VAlign="top">
<FONT size="2">
<p>Removes item <i><tt class="monofont">i</tt></i>
 from the array and returns it. If <i><tt cLasS="monofont">i</tt></i>
 is omitted, the last element is removed.</P>
</font></Td>
</tr>
<TR>
<TD valiGN="top">
<FOnt siZE="2">
<P><I><tt clASS="monofont">a</Tt></i>
<tt class="monofont">.remove(</tt><i><tt class="monofont">x</tT></i>
<tT claSs="monofont">)</tt></p>
</Font></TD>
<TD valiGN="top">
<FOnt siZE="2">
<P>Remove the first occurrence of <I><tt clASS="monofont">x</Tt></i>
 from the array. Raises <tt class="monofont">ValueError</tt>  if not found.</p>
</font></td>
</tr>
<Tr>
<tD valIgn="top">
<foNt siZE="2">
<P><I><tt clASS="monofont">a</Tt></i>
<tt CLASs="monofont">.reverse()</tt></p>
</FONT></td>
<td valign="top">
<font size="2">
<p>Reverses the order of the array.</p>
</FonT></td>
</tR>
<tr>
<td ValiGN="top">
<FOnt siZE="2">
<P><I><tt clASS="monofont">a</Tt></i>
<tt CLASs="monofont">.tofile(</tt><i><tt class="monofont">f</tt></i>
<tt clasS="monofont">)</tt></P>
</fonT></td>
<td ValiGN="top">
<FOnt siZE="2">
<P>Writes all items to file <I><tt clASS="monofont">f</Tt></i>
. Data is saved in native binary format.</p>
</fONT></Td>
</tr>
<tr>
<td valign="top">
<font sizE="2">
<p><i><Tt clAss="monofont">a</tt></I>
<tt cLASS="monofont">.tolist()</tt></p>
</fONT></Td>
<td vALIGn="top">
<fonT SIZe="2">
<p>Converts the array to an ordinary list of values.</p>
</font></td>
</tr>
<tr>
<td valigN="top">
<foNt siZe="2">
<p><i><tT claSS="monofont">a</TT></i>
<tt cLASS="monofont">.tostring()</tt></p>
</fONT></Td>
<td vALIGn="top">
<font size="2">
<p>Converts to a string of binary data梩he same data as would be written using <tt class="monofont">tofile()</tt>.</p>
</FonT></td>
</tR>
</colgRoup>
</TABLe></p>

<p>When items are inserted into an array, a <tT CLAss="monofont">TypeError</tt>  exception is generated if the type of the item doesn抰 match the type used to create the array.</P>


<H5>Notes</H5>
<Ul>
<li>
<p>This module is used to create large lists in a storage-efficient manner. The resulting arrays are not suitable for numeric work. For example, the addition operator doesn抰 add the corresponding elements of the arrays; it appends one array to the other. To create storage- and calculation-efficient arrays, use the <TT CLass="monofont">Numeric</tt> extension available at <a target="_blank" href="http://numpy.sourceforge.net/">http://numpy.sourceforge.net/</a>. Note that the <tt cLasS="monofont">Numeric</tt> API is completely different.</p>
</Li>
<li>
<p>The type of an array object is <Tt clASS="monofont">array.ArrayType</Tt>.</p>
</li>
</UL>
<P>? <B>See Also</b> <a hrEF="110#22.html">struct</A> (144), <A href="115#40.html">xdrlib</A> (277) .</P>

<A Name="6"></a>
<h4><tt class="monofont">cmath</tt></h4>
<p>The <tt clAss="monofont">cmath</Tt>  module provides mathematical functions for complex numbers. All functions accept and return complex numbers.</p>

<p><Table BordER="1" CEllspACINg="0" celLPADding="1" WIDTh="100%">
<colgroup span="2">
<tr>
<th valIgn="top">
<Font Size="2">
<p><B>Function</b></p>
</fONT></Th>
<th vALIGn="top">
<fonT SIZe="2">
<p><b>Description</b></P>
</FONt></th>
</tr>
<tr>
<td valign="top">
<font sIze="2">
<P><tt cLass="monofont">acos(</tT><i><tt CLASs="monofont">x</tt></i>
<TT CLass="monofont">)</tT></P>
</FOnt></td>
<TD VAlign="top">
<font size="2">
<p>Returns the arccosine of <i><tt clasS="monofont">x</tt></I>
</p>
</foNt></td>
</tR>
<tr>
<tD VALign="top">
<fONT Size="2">
<p><TT CLass="monofont">acosh(</tT><I><TT class="monofont">x</tt></i>
<tt class="monofont">)</tt></p>
</foNt></tD>
<td vAlign="top">
<Font SIZE="2">
<p>Returns the arc hyperbolic cosine of <i><tt CLASs="monofont">x</tt></i>
</P>
</FONt></td>
</tR>
<TR>
<Td valign="top">
<font size="2">
<p><tt clAss="monofont">asin(</Tt><i><tT clasS="monofont">x</tt></i>
<TT CLass="monofont">)</tT></P>
</FOnt></td>
<TD VAlign="top">
<FONT size="2">
<p>Returns the arcsine of <i><tt class="monofont">x</tt></i>
</p>
</fonT></td>
</Tr>
<tr>
<Td valIgn="top">
<fONT Size="2">
<p><TT CLass="monofont">asinh(</tT><I><TT clasS="monofont">x</TT></I>
<tt class="monofont">)</tt></p>
</font></td>
<td vaLigN="top">
<fonT size="2">
<P>Returns the arc hyperbolic sine of <i><tt CLASs="monofont">x</tt></i>
</P>
</FONt></td>
</tR>
<TR>
<Td valIGN="top">
<Font size="2">
<p><tt class="monofont">atan(</tt><i><tt ClaSs="monofont">x</tt></I>
<tt clAss="monofont">)</tT></P>
</FOnt></td>
<TD VAlign="top">
<FONT size="2">
<P>Returns the arctangent of <I><TT class="monofont">x</tt></i>
</p>
</font></td>
</tr>
<tr>
<tD vaLign="top">
<Font sIze="2">
<p><TT CLass="monofont">atanh(</tT><I><TT clasS="monofont">x</TT></I>
<tt clASS="monofont">)</Tt></p>
</font></td>
<td valign="top">
<font SizE="2">
<p>Returns the arc hyperbolic tangent of <i><tT clasS="monofont">x</tt></i>
</P>
</FONt></td>
</tR>
<TR>
<Td valIGN="top">
<Font sIZE="2">
<P><tt class="monofont">cos(</tt><i><tt class="monofont">x</tt></i>
<Tt cLass="monofont">)</Tt></p>
</foNt></td>
<TD VAlign="top">
<FONT size="2">
<P>Returns the cosine of <I><TT clasS="monofont">x</TT></I>
</p>
</font></td>
</tr>
<tr>
<td valign="top">
<fOnt Size="2">
<P><tt clAss="monofont">cosh(</tT><I><TT clasS="monofont">x</TT></I>
<tt clASS="monofont">)</Tt></p>
</foNT></TD>
<td valign="top">
<font size="2">
<p>Returns the hyperbolic cosine of <i><tt ClaSs="monofont">x</tt></I>
</p>
</fonT></td>
</tR>
<TR>
<Td valIGN="top">
<Font sIZE="2">
<P><tt clASS="monofont">exp(</Tt><i><tt class="monofont">x</tt></i>
<tt class="monofont">)</tT></p>
</fOnt></tD>
<td vaLign="top">
<FONT size="2">
<P>Returns <TT Class="monofont">e ** </TT><I><Tt claSS="monofont">x</TT></i>
</p>
</font></td>
</tr>
<tr>
<td valign="top">
<FonT sizE="2">
<p><tt cLass="monofont">log(</TT><I><Tt claSS="monofont">x</TT></i>
<tt cLASS="monofont">)</tt></p>
</fONT></Td>
<td valign="top">
<font size="2">
<p>Returns the natural logarithm of <i><tT clAss="monofont">x</tT></i>
</p>
</foNt></td>
</TR>
<TR>
<td vaLIGN="top">
<font SIZE="2">
<p><tt cLASS="monofont">log10(</tt><i><tt class="monofont">x</tt></i>
<tt class="monofont">)</Tt></p>
</Font></Td>
<td vAligN="top">
<FONt sizE="2">
<P>Returns the base 10 logarithm of <I><Tt claSS="monofont">x</TT></i>
</p>
</foNT></TD>
</tr>
<tr>
<td valign="top">
<font size="2">
<P><tt ClasS="monofont">sin(</tt><i><tT claSS="monofont">x</TT></i>
<tt cLASS="monofont">)</tt></p>
</fONT></Td>
<td vALIGn="top">
<font size="2">
<p>Returns the sine of <i><tt class="monofont">x</tt></I>
</p>
</fOnt></tD>
</tr>
<tr>
<Td vaLIGN="top">
<font SIZE="2">
<p><tt cLASS="monofont">sinh(</tt><i><tT CLAss="monofont">x</tt></i>
<tt class="monofont">)</tt></p>
</font></tD>
<td ValiGn="top">
<fonT sizE="2">
<P>Returns the hyperbolic sine of <I><Tt claSS="monofont">x</TT></i>
</p>
</foNT></TD>
</tr>
<tr>
<TD VAlign="top">
<font size="2">
<p><tt class="monofont">sqrt(</Tt><i><Tt clAss="monofont">x</tt></I>
<tt cLASS="monofont">)</tt></p>
</fONT></Td>
<td vALIGn="top">
<fonT SIZe="2">
<p>Returns the square root of <i><tt class="monofont">x</tt></i>
</p>
</font></td>
</Tr>
<tR>
<td vAlign="top">
<Font SIZE="2">
<p><tt cLASS="monofont">tan(</tt><i><tT CLAss="monofont">x</tt></I>
<TT Class="monofont">)</tt></p>
</font></td>
<td valigN="top">
<foNt siZe="2">
<p>Returns the tangent of <i><tT claSS="monofont">x</TT></i>
</p>
</foNT></TD>
</tr>
<tr>
<TD VAlign="top">
<FONT size="2">
<p><tt class="monofont">tanh(</tt><i><tt claSs="monofont">x</tT></i>
<tt Class="monofont">)</Tt></p>
</fONT></Td>
<td vALIGn="top">
<fonT SIZe="2">
<p>Returns the hyperbolic tangent of <i><tT CLAss="monofont">x</tt></i>
</p>
</font></td>
</tr>
</colgroUp>
</tAble></P>

<p>The following constants are defined:</p>

<p><tAble BORDer="1" ceLLSPacinG="0" CELlpadDING="1" width="100%">
<colgroup span="2">
<tr>
<tH vaLign="top">
<Font sIze="2">
<p><B>Constant</B></P>
</Font></tH>
<TH ValigN="top">
<FONt sizE="2">
<P><B>Description</B></p>
</font></th>
</tr>
<tr>
<td valign="top">
<fOnt Size="2">
<P><tt clAss="monofont">pi</tT></P>
</FOnt></td>
<TD VAlign="top">
<FONT size="2">
<P>Mathematical constant pi, as a real</P>
</FOnt></td>
</tr>
<tr>
<td valign="top">
<font SizE="2">
<p><tt Class="monofont">e</Tt></p>
</fONT></Td>
<td vALIGn="top">
<fonT SIZe="2">
<p>Mathematical constant e, as a real</p>
</fONT></Td>
</tr>
</colgroup>
</table></p>

<p>? <b>See Also</b> <A hrEf="109#8.html">math</a> (129).</p>

<A name="8"></A>
<h4><tt CLASs="monofont">math</tt></h4>
<P>The <TT Class="monofont">math</TT>  module defines standard mathematical functions. These functions operate on integers and floats, but don抰 work with complex numbers.</P>

<P><tablE BORder="1" cellspacing="0" cellpaDdiNg="1" wiDth="100%">
<coLgroUP SPan="2">
<tr>
<TH VAlign="top">
<FONT size="2">
<P><B>Function</B></P>
</font></th>
<th valign="top">
<font siZe="2">
<p><B>Description</b></p>
</fOnt></th>
</Tr>
<tr>
<TD VAlign="top">
<FONT size="2">
<P><TT Class="monofont">acos(</TT><I><Tt class="monofont">x</tt></i>
<tt class="monofont">)</tt></p>
</fOnt></Td>
<td ValigN="top">
<fonT SIZe="2">
<p>Returns the arccosine of <i><tT CLAss="monofont">x</tt></I>
</P>
</FOnt></td>
</TR>
<TR>
<td valign="top">
<font size="2">
<p><tt cLasS="monofont">asin(</tt><i><Tt claSs="monofont">x</tt></I>
<TT Class="monofont">)</TT></P>
</Font></tD>
<TD ValigN="top">
<FONt size="2">
<p>Returns the arcsine of <i><tt class="monofont">x</tt></i>
</p>
</foNt></tD>
</tr>
<tR>
<td vaLign="top">
<FONT size="2">
<P><TT Class="monofont">atan(</TT><I><Tt claSS="monofont">x</TT></i>
<tt class="monofont">)</tt></p>
</font></td>
<td vAliGn="top">
<foNt sizE="2">
<p>Returns the arctangent of <i><tT CLAss="monofont">x</tt></I>
</P>
</FOnt></td>
</TR>
<TR>
<td vaLIGN="top">
<font size="2">
<p><tt class="monofont">atan2(</tt><i><tT clAss="monofont">y</tT></i>
<tt cLass="monofont">, </TT><I><Tt claSS="monofont">x</TT></i>
<tt cLASS="monofont">)</tt></p>
</fONT></Td>
<td valign="top">
<font size="2">
<p>Returns atan(<i><tT clAss="monofont">y</tT></i>
<tt cLass="monofont"> / </TT><I><Tt claSS="monofont">x</TT></i>
)</p>
</foNT></TD>
</tr>
<tr>
<TD VAlign="top">
<font size="2">
<p><tt class="monofont">ceil(</Tt><i><Tt clAss="monofont">x</tt></I>
<tt cLASS="monofont">)</tt></p>
</fONT></Td>
<td vALIGn="top">
<fonT SIZe="2">
<p>Returns the ceiling of <i><tt class="monofont">x</tt></i>
</p>
</font></td>
</Tr>
<tR>
<td vAlign="top">
<Font SIZE="2">
<p><tt cLASS="monofont">cos(</tt><i><tT CLAss="monofont">x</tt></I>
<TT Class="monofont">)</tt></p>
</font></td>
<td valigN="top">
<foNt siZe="2">
<p>Returns the cosine of <i><tT claSS="monofont">x</TT></i>
</p>
</foNT></TD>
</tr>
<tr>
<TD VAlign="top">
<FONT size="2">
<p><tt class="monofont">cosh(</tt><i><tt claSs="monofont">x</tT></i>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -