Python Programming – NumPy Installation
Published: 2021-06-28 06:19:25

<h2>Python Programming – NumPy Installation</h2>
<strong>Numpy installation</strong>

This section discusses the simple installation approaches of NumPy in different operating system.

<strong>Windows</strong>

By default, NumPy is not shipped with official Python installer. But one can download (from website link: http://sourceforge.net/projects/numpy/files/NumPy/) the executable file of NumPy (recent version 1.8.1) followed by installing it. Before installing NumPy, please make sure that Python is already installed. NumPy is already included in Python(x,y) package, so one does not have to install NumPy separately, if the programmer is using Python(x,y).

<strong>Linux</strong>

One can install NumPy in Ubuntu (Linux) operating system by executing the following commands in the terminal (as shown in figure 6-1).
<pre>sudo apt-get install python-numpy</pre>
<img class="alignnone size-full wp-image-3908" src="https://btechgeeks.com/wp-content/uploads/2021/04/Python-Handwritten-Notes-Chapter-7-img-1.png" alt="Python Handwritten Notes Chapter 7 img 1" width="552" height="333" />

<strong>Data types</strong>

Some of the data types supported by NumPy are given in table 6-1.
<table>
<tbody>
<tr>
<td width="96">
<p style="text-align: center;">Data type</p>
</td>
<td width="528">
<p style="text-align: center;">Description</p>
</td>
</tr>
<tr>
<td width="96">bool_</td>
<td width="528">Boolean (True or False) stored as a byte.</td>
</tr>
<tr>
<td width="96">intS</td>
<td width="528">Byte (ranging from -128 to 127).</td>
</tr>
<tr>
<td width="96">intl6</td>
<td width="528">Integer (ranging from -32768 to 32767).</td>
</tr>
<tr>
<td width="96">int32</td>
<td width="528">Integer (ranging from -2147483648 to 2147483647).</td>
</tr>
<tr>
<td width="96">int64</td>
<td width="528">Integer (ranging from -9223372036854775808 to 9223372036854775807).</td>
</tr>
<tr>
<td width="96">uint8</td>
<td width="528">Unsigned integer (ranging from 0 to 255).</td>
</tr>
<tr>
<td width="96">uintl6</td>
<td width="528">Unsigned integer (ranging from 0 to 65535).</td>
</tr>
<tr>
<td width="96">uint32</td>
<td width="528">Unsigned integer (ranging from 0 to 4294967295).</td>
</tr>
<tr>
<td width="96">uint64</td>
<td width="528">Unsigned integer (ranging from 0 to 18446744073709551615).</td>
</tr>
<tr>
<td width="96">float_</td>
<td width="528">Shorthand for float64.</td>
</tr>
<tr>
<td width="96">floatl6</td>
<td width="528">Half precision float: sign bit, 5 bits exponent, 10 bits mantissa.</td>
</tr>
<tr>
<td width="96">float32</td>
<td width="528">Single precision float: sign bit, 8 bits exponent, 23 bits mantissa.</td>
</tr>
<tr>
<td width="96">float64</td>
<td width="528">Double precision float: sign bit, 11 bits exponent, 52 bits mantissa.</td>
</tr>
<tr>
<td width="96">complex_</td>
<td width="528">Shorthand for complexl28.</td>
</tr>
<tr>
<td width="96">complex64</td>
<td width="528">Complex number, represented by two 32-bit floats (real and imaginary components).</td>
</tr>
<tr>
<td width="96">complexl28</td>
<td width="528">Complex number, represented by two 64-bit floats (real and imaginary components).</td>
</tr>
</tbody>
</table>

In this Page, We are Providing Python Programming – Numpy Installation. Students can visit for more Detail and Explanation of <a href="https://btechgeeks.com/python-handwritten-notes/">Python Handwritten Notes</a> Pdf.