Dizi Manipülasyon

Transposing Array

i = np.transpose(b) #Permute array dimensions
i.T #Permute array dimensions

Changing Array Shape

b.ravel() #Flatten the array
g.reshape(3, -2) #Reshape, but don’t change data

Adding/Removing Elements

>>>h.resize((2,6)) #Return a new arraywith shape(2,6)
>>> np.append(h,g) #Append items to an array
>>> np.insert(a,1,5)  #Insert items in an array
>>> np.delete(a,[1])  #Delete items from an array

Combining Arrays 

>>> np.concatenate((a,d),axis=0) #Concatenate arrays
array([1, 2, 3, 10, 15, 20])
>>> np.vstack((a,b) #Stack arrays vertically(row wise)
array([[1. , 2. , 3.],[1.5, 2. , 3.],[ 4. ,5. , 6. ]])
>>> np.r_[e,f] #Stack arrays vertically(row wise)
>>> np.hstack((e,f)) #Stack arrays horizontally(column wise)
array([[7.,7.,1.,0.],[7.,7.,0.,1.]])
>>> np.column_stack((a,d)) #Create stacked column wise arrays
array([[1, 10],[ 2, 15],[ 3, 20]])
>>> np.c_[a,d] #Create stacked column wise arrays

Splitting Arrays

>>> np.hsplit(a,3) #Split the array horizontally at the 3rd index
  [array([1]),array([2]),array([3])]
>>> np.vsplit(c,2) #Split the array vertically at the 2nd index
  [array([[[ 1.5, 2. ,1.],[ 4. ,5. , 6. ]]]),
   array([[[ 3., 2., 3.],[ 4.,5., 6.]]])]