Kopyalama (Copying Arrays)
h = a.view()#Create a view of the array with the same data
np.copy(a) #Create a copy of the array
h = a.copy() #Create a deep copy of the array
Sıralama (Sorting Arrays)
a.sort() #Sort an array
c.sort(axis=0) #Sort the elements of an array's axis
Kümeleme (Subsetting)
a[2] #Select the element at the 2nd index
3
b[1,2] #Select the element at row 1 column 2(equivalent to b[1][2])
6.0
Dilimleme (Slicing)
a[0:2]#Select items at index 0 and 1
array([1, 2])
b[0:2,1] #Select items at rows 0 and 1 in column 1
array([ 2.,5.])
b[:1]
#Select all items at row0(equivalent to b[0:1, :])
array([[1.5, 2., 3.]])
c[1,...] #Same as[1,:,:]
array([[[ 3., 2.,1.],[ 4.,5., 6.]]])
a[ : : -1] #Reversed array a array([3, 2, 1])
Dizinleme (indexing)
a[a<2] #Select elements from a less than 2
array([1])
b[[1,0,1, 0],[0,1, 2, 0]] #Select elements(1,0),(0,1),(1,2) and(0,0)
array([ 4. , 2. , 6. ,1.5])
b[[1,0,1, 0]][:,[0,1,2,0]] #Select a subset of the matrix’s rows and columns
array([[ 4. ,5. , 6. , 4.],[1.5, 2. , 3. ,1.5],[ 4. ,5. , 6. , 4.],[1.5, 2. , 3. ,1.5]])