__Introduction to Python NumPy Library__

- NumPy is the fundamental package for scientific computing in Python. It is a Python library that provides a multidimensional array object, various derived objects (such as masked arrays and matrices),
- and an assortment of routines for fast operations on arrays, including mathematical, logical, shape manipulation, sorting, selecting, I/O, discrete Fourier transforms, basic linear algebra, basic statistical operations, random simulation and much more.

__Numeric____ :__

__Numeric__

__:__

- The ancestor of NumPy, was developed by Jim Hugunin. Another package Numarray was also developed, having some additional functionalities.

- In 2005, Travis Oliphant created NumPy package by incorporating the features of Numarray into Numeric package. There are many contributors to this open source project.

__NumPy written In Python and C__

__NumPy written In Python and C__

- NumPy targets the
**CPython**reference implementation of Python, which is a non-optimizing bytecode interpreter.

- Mathematical algorithms written for this version of Python often run much slower than compiled equivalents.

- NumPy addresses the slowness problem partly by providing multidimensional arrays and functions and operators that operate efficiently on arrays, requiring rewriting some code, mostly inner loops, using NumPy.

__Cpython :__

__Cpython :__

- CPython is the reference implementation of the Python programming language. Written in C and Python, CPython is the default and most widely used implementation of the language.

- CPython can be defined as both an interpreter and a compiler as it compiles Python code into bytecode before interpreting it.

- It has a foreign function interface with several languages including C, in which one must explicitly write bindings in a language other than Python.

**Why is NumPy Fast?**

Vectorization describes the absence of any explicit looping, indexing, etc., in the code - these things are taking place, of course, just “behind the scenes” in optimized, pre-compiled C code. Vectorized code has many advantages, among which are:

- vectorized code is more concise and easier to read
- fewer lines of code generally means fewer bugs
- the code more closely resembles standard mathematical notation (making it easier, typically, to correctly code mathematical constructs)
- vectorization results in more “Pythonic” code. Without vectorization, our code would be littered with inefficient and difficult to read for loops.

## 2 Comments

Hello Shivam i am anshu

ReplyDeleteAnshu pratap ??

DeleteIf you have any doubts, Please let me know