0% found this document useful (0 votes)
1 views5 pages

NumPy New

NumPy is a powerful Python library for mathematical and scientific calculations, primarily using its core data structure, the ndarray, which is faster and more efficient than standard Python lists. It is widely used in data science, machine learning, and scientific computing for handling large datasets and performing complex mathematical operations. The document also covers how to install NumPy, create arrays, and perform basic operations, along with examples of different types of arrays and useful NumPy functions.

Uploaded by

kailashyadavhbti
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1 views5 pages

NumPy New

NumPy is a powerful Python library for mathematical and scientific calculations, primarily using its core data structure, the ndarray, which is faster and more efficient than standard Python lists. It is widely used in data science, machine learning, and scientific computing for handling large datasets and performing complex mathematical operations. The document also covers how to install NumPy, create arrays, and perform basic operations, along with examples of different types of arrays and useful NumPy functions.

Uploaded by

kailashyadavhbti
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

1 TECHNICIA PYTHON Numpay Notes

NumPy (Numerical Python) ek powerful Python library hai jo


mathematical aur scientific calculations ke liye use hoti hai.

Numerical Python

NumPy ka main concept

NumPy ka core concept hai array (ndarray)


Ye normal Python list se zyada fast aur efficient hota hai.

NumPy ka use kyu karte hain?

1. Fast Calculation

o NumPy C language par based hota hai

o Isliye Python list se bahut fast calculate karta hai

2. Large Data Handling

o Millions of data points ko easily handle karta hai

o Data Science & Machine Learning me bahut use hota hai

3. Scientific Computing

o Matrix operations

o Linear algebra

o Statistics

o Complex mathematical functions

Real Life Use

 Data Science

 Machine Learning

 AI Projects

 Image Processing

 Financial Analysis
2 TECHNICIA PYTHON Numpay Notes

NumPy ko kaise implement

1. NumPy install karna

Agar system me pehle se nahi hai to:

pip install numpy

2. NumPy import karna

Python me use karne ke liye:

import numpy as np

3. Array banana (Basic Implementation)

import numpy as np
a = [Link]([1, 2, 3, 4])
print(a)

4. Operations perform karna


Addition
a = [Link]([1,2,3])
b = [Link]([4,5,6])
print(a + b)
3 TECHNICIA PYTHON Numpay Notes

NumPy Array (ndarray) ek data structure hai jo multiple values ko ek hi


variable me store karta hai — bilkul list ki tarah, lekin zyada fast aur
powerful.

import numpy as np
a = [Link]([10, 20, 30, 40])
print(a)

types of ARRAY

 1D Array → Single row


 2D Array → Matrix
 3D Array → Multiple matrices

1. 1D Array → Single row : 1D Array (One-Dimensional Array) ek aisa array


hota hai jisme data sirf ek line (row) me store hota hai.

Syntax
import numpy as np
array_name = [Link]([value1, value2, value3])
Example
import numpy as np
a = [Link]([10, 20, 30, 40])
print(a)

2. 2D Array : 2D Array ek aisa array hota hai jisme data rows aur
columns (table form) me hota hai.

import numpy as np
array_name = [Link]([[value1, value2], [value3, value4]])

Example
import numpy as np
a = [Link]([[1, 2, 3],
[4, 5, 6]])
print(a)

3. Multi Dimensional Array

3D Array ek aisa array hota hai jisme data multiple layers (arrays ke
upar arrays) me hota hai.

Syntax

import numpy as np
4 TECHNICIA PYTHON Numpay Notes

array_name = [Link]([[[v1, v2],


[v3, v4]],

[[v5, v6],
[v7, v8]]])

Example
import numpy as np
a = [Link]([[[1, 2],
[3, 4]],
[[5, 6],
[7, 8]]])
print(a)
[Link] Array Functions
[Link]() → 0 se bhara array Ye function saare elements 0 ke saath
array banata hai
Syntax

[Link](shape)

Example

import numpy as np
a = [Link]((2,3))
print(a)

Output:

[[0. 0. 0.]
[0. 0. 0.]]

2. [Link]() → 1 se bhara array


Ye function saare elements 1 ke saath array banata hai
Syntax
[Link](shape)
Example
import numpy as np
a = [Link]((2,2))
print(a)

Output:
5 TECHNICIA PYTHON Numpay Notes

[[1. 1.]
[1. 1.]]

3. [Link]() → range generate

Ye function range ke andar numbers generate karta hai

Syntax

[Link](start, stop, step)

Example

import numpy as np
a = [Link](1, 10, 2)
print(a)

Output:

[1 3 5 7 9]

4. [Link]() → equal spacing

Ye function start aur end ke beech equal distance par values banata
hai

Syntax

[Link](start, stop, num)

 num = total values kitni chahiye

Example

import numpy as np

a = [Link](1, 10, 5)
print(a)

Output:

[ 1. 3.25 5.5 7.75 10. ]

You might also like