Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

Python NumPy delete Function Example Deletion performed using Boolean Mask

# welcome to softhunt.net
# Python Program illustrating
# numpy.delete()

import numpy as np

arr = np.arange(5)
print("Original array : ", arr)
mask = np.ones(len(arr), dtype=bool)

# Equivalent to np.delete(arr, [0,2,4], axis=0)
mask[[0,2]] = False
print("
Mask set as : ", mask)
result = arr[mask,...]
print("
Deletion Using a Boolean Mask : ", result)
Comment

PREVIOUS NEXT
Code Example
Python :: Python NumPy tile Function Example when (repetitions == arr.ndim) == 0 
Python :: Python NumPy dsplit Function 
Python :: tf idf vectorizer regression -logistic 
Python :: como saber si un string es un numero python 
Python :: max index tuple 
Python :: python __div__ 
Python :: Python how to use __truediv__ 
Python :: modles en django 
Python :: NumPy bitwise_and Example When inputs are Boolean 
Python :: funcs_and_args for loop python 
Python :: sourcetrail index library python 
Python :: NumPy binary_repr Syntax 
Python :: ax bar different colors 
Python :: #check if the given date is a weekday or weekend 
Python :: downgrading to previous migration django 
Python :: Remove Brackets from List Using join method with loop 
Python :: server localhost for shar file 
Python :: BeautifulSoup : Fetched all the links on a webpage how to navigate through them without selenium 
Python :: print banner in python 
Python :: how to make a yes or no question in python 
Python :: how to access specific index of matrix in python 
Python :: python pyramid pattern 
Python :: Express + Jade : Ensuring url paths are correct via controllers, orphaned links 
Python :: replace dataframe column element if element is within a specific list 
Python :: ring add new items to the list using the string index 
Python :: z3 symbolic expressions cannot be cast to concrete boolean values 
Python :: convert all date columns using pd.datetime 
Python :: OfficeApi 
Python :: regression avec sklearn best 
Python :: seleniu get element value and store it in a variable - selenium remember user 
ADD CONTENT
Topic
Content
Source link
Name
6+2 =