Horje
numpy remove object from array Code Example
remove element from np array
import numpy as np

a = np.array([1, 2, 3, 4, 5, 6, 7, 8, 9])
index = [2, 3, 6]

new_a = np.delete(a, index)

print(new_a) #Prints `[1, 2, 5, 6, 8, 9]`
numpy remove object from array
new_arr = np.delete(arr, np.where(arr == 2))
Source: www.kite.com




Python

Related
python regular expression escape vertical bar | Code Example python regular expression escape vertical bar | Code Example
subprocess the system cannot find the file specifie Code Example subprocess the system cannot find the file specifie Code Example
how to interrupt a loop in python Code Example how to interrupt a loop in python Code Example
clear variable jupyter notebook Code Example clear variable jupyter notebook Code Example
decode multipart/form-data python lambda Code Example decode multipart/form-data python lambda Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
7