NumPy Sorting Arrays In Hindi

Numpy

NumPy Sorting Arrays In Hindi – Numpy Sorting Ka Istemal Array Yani Ki List Ko Sort Karne Ke Liye Istemal Kiya Jata Hai, Waise Ye Sort Inhe numeric or alphabetical, ascending or descending Me Karta Hai.

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 |

NumPy Sorting Arrays In Hindi

Agar Aapko Arrays Ko Sort Karna Hai To Aap Sort Function Ka Istemal Kar Sakte hai, Python Me Sort Karne Ke Liye sort keyword Ka Istemal Kiya Jata Hai, Ise Ham Example Ke Sath Dekthe Hai |

Example 1:

import numpy as np

arr = np.array([3, 2, 0, 1])

print(np.sort(arr))

Output:

[0 1 2 3]

Example 2:

import numpy as np

arr = np.array(['banana', 'cherry', 'apple'])

print(np.sort(arr))

Output:

['apple' 'banana' 'cherry']

Example 3:

import numpy as np

arr = np.array([[3, 2, 4], [5, 0, 1]])

print(np.sort(arr))

Output:

[[2 3 4]
 [0 1 5]]

Leave a Reply

Your email address will not be published. Required fields are marked *