# Create Numpy Arrays Using Functions – Numpy In Hindi

Create Numpy Arrays Using Functions in HindiNumpy In Hindi – Numpy Arrays Ko Ham Functions Ke Sath Bhi Create Kar Sakte Hain |

Yadi Aapne  HTML Full Course  And CSS Full Course And Python Full Course And PHP Full Course Nhi Read Kiya Hai To Aap Vah Bhi Read Kar Sakte Hai |

## Create Numpy Arrays Using Functions

Arrays Ko Functions Ke Sath Create Karne Ke Liye Koi Types Ke Functions Diye Gaye Hain Joki Alag Alag Tarah Se Numpy Arrays Ko Create Karte Hain.

• zeros
• ones
• eye
• diag
• randint
• rand
• randn

In Functions Ko Ham Ek Ek Karke Dekhne Wale Hai |

### Zeros Functions In Hindi

Zeros Functions Ka Istemal karne Se Ham Numpy Zeros Array Create Kar Sakte Hai.

Example:

```import numpy as np
arr = np.zeros(2)
print(arr)```

Output:

`array([0., 0.])`

### Ones Functions In Hindi

Ones Function Ka Istemal Karke Ham Numpy ones Array Create Kar Sakte Hai. Isme Keval 1 Number Honge |

Example:

```import numpy as np
arr = np.ones(2)
print(arr)```

Output:

`array([1., 1.])`

### Eye Functions In Hindi

Eye Function Ka Istemal Karke Aap Diagonal Matrix Create Kar Sakte Hai. Lekin Is Diagonal Matrix Elements Keval 1 Hoga And Ye 2-D Martix Create Karega |

Example:

```import numpy as np
arr = np.eye(4)
print(arr)```

Output:

```array([[1., 0., 0., 0.],
[0., 1., 0., 0.],
[0., 0., 1., 0.],
[0., 0., 0., 1.]])```

### Diag Functions In Hindi

Diag Function Ka Istemal Karke Aap Diagonal Matrix With Choices Number Ke Sath Create Kar Sakte Hain. Ye Input Me List Leta Hai |

Example:

```import numpy as np
ls = [1,2,3,4]
arr = np.diag(ls)
print(arr)```

Output:

```array([[1, 0, 0, 0],
[0, 2, 0, 0],
[0, 0, 3, 0],
[0, 0, 0, 4]])```

### Randint Functions In Hindi

randint Functions Ka Istemal Karke Ham Random Number Matrix Create Kar Sakte Hai.

Isme Ham 3 Value Pass Karte Hai – Low , High , Number

Example:

```import numpy as np
arr = np.random.randint(1,10,5)
print(arr)```

Output:

`array([6, 2, 5, 7, 2])`

### Rand Functions In Hindi

Rand Function ka Istemal karke Ham random Floating 0 or 1 Ke Bich Me Generate Kara Sakte Hai |

Example:

```import numpy as np
arr = np.random.rand(5)
print(arr)```

Output:

`array([0.52580758, 0.41356057, 0.19416662, 0.2760978 , 0.12535946])`

### Randn Functions In Hindi

Randn Functions Ka Istemal Karke Standard Number Zero ke Bich me Create Kar Sakte Hai Or Fir Aap Iska Mean Nikal Sakte Hain And Isme Negative Or Positive Number Dono Honge |

Example:

```import numpy as np
arr = np.random.randn(5)
print(arr)```

Output:

`array([ 0.25505529,  1.00033365, -0.98209137, -0.75438967,  0.91431776])`

Also Read – NumPy – Environment + Setup + Anaconda

Friends Mujhe Umeed Hai Ki Aapko Create Numpy Arrays Using Functions in Hindi Ke Bare Mai 100% Jankari Ho Gayi Hogi | Agar Aapko Learn Karne Main Dikkat Aa Rahi Hai To Aap Mere Se Contact Kar Sakte Hai |