Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

delete values with condition in numpy

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

out = np.logical_not(a < 3) 

print(out) # array([False, False,  True,  True,  True,  True])
print(a[out]) # array([3, 4, 5, 6])
Comment

PREVIOUS NEXT
Code Example
Python :: __str__() 
Python :: post to instagram from pc python 
Python :: python open and read file with 
Python :: get just filename without extension from the path python 
Python :: write a python program to find table of a number using while loop 
Python :: find all files containing a string in python with glob module 
Python :: elon musk wikipedia 
Python :: python closure 
Python :: turn df to dict 
Python :: -1 in numpy reshape 
Python :: python file open 
Python :: make tkinter label and input 
Python :: delete columns pandas 
Python :: remove string punctuation python 3 
Python :: tkinter template 
Python :: python get file path 
Python :: LoginRequiredMixin 
Python :: python anagram finder 
Python :: python generate random string 
Python :: label point matplotlib 
Python :: how to url encode using python django 
Python :: skip element in list comprehension 
Python :: nn.dropout 
Python :: matplotlib to pdf 
Python :: numpy combinations of 5 bits 
Python :: python slice dictionary 
Python :: how to add an item to a dictionary in python 
Python :: python hide details 
Python :: with in python 
Python :: python add two numbers 
ADD CONTENT
Topic
Content
Source link
Name
3+2 =