Tag: NumPy
What Advantage does the NumPy Array have over a nested list?
Naveen
- 0
NumPy is written in C so that all its complexities are backed into a simple to use a module. Lists, on the other hand, the dynamically typed. Therefore, Python must check the data type of each element every time it uses it. This makes NumPy arrays much faster than lists. NumPy has a lot od…
Read MoreNumPy for Data Science – Part 5
Naveen
- 0
The difference between copy and view Copy The copy owns the data The copy of an array is a new array. The changes made in the copy data does not reflect in the original array. View The view does not own the data A view of the original array. Any changes made in the view…
Read MoreNumPy for Data Science – Part 4
Naveen
- 0
Broadcasting NumPy Arrays The term broadcasting describes how NumPy treats arrays with different shapes during arithmetic operations. Subject to certain constraints, the smaller array is “broadcast” across the larger array in order that they have compatible shapes. NumPy operations are usually done on pairs of arrays on an element-by-element basis. Within the simplest case, the…
Read MoreNumPy for Data Science – Part 3
Naveen
- 0
Arithmetic Operations in NumPy Arrays In NumPy there are multiple functions which we can use to perform the arithmetic operation, we will be looking them one by one. The add() function can also be used to perform the same operation. The subtract() function can also be used to perform the same operation. The multiply() function…
Read MoreNumPy for Data Science – Part 2
Naveen
- 0
Create NumPy Arrays with Random Numbers rand() – the function is used to generate value between 0 to 1. randn() – the function is used to generate value close to zero. This may return positive or negative numbers as well. ranf() – the function for doing random sampling in NumPy. It returns an Array of…
Read MoreNumPy for Data Science – Part 1
Naveen
- 0
What is NumPy Array? An array is a grid of values and it contains information about the raw data, how to locate an element, and how to interpret an element. Numpy vs Python List Advantages of using NumPy Arrays over Python List: Consumes less memory. Fast as compared to the Python List. Convenient to use.…
Read More