Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python numpy delete element from array

array = np.delete(array, 2)
Comment

Python NumPy delete Function Example Deletion from 1D array

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

import numpy as np

#Working on 1D
arr = np.arange(5)
print("arr : 
", arr)
print("Shape : ", arr.shape)

# deletion from 1D array

object = 2
a = np.delete(arr, object)
print("
deleteing {} from array : 
 {}".format(object,a))
print("Shape : ", a.shape)

object = [1, 2]
b = np.delete(arr, object)
print("
deleteing {} from array : 
 {}".format(object,a))
print("Shape : ", a.shape)
Comment

PREVIOUS NEXT
Code Example
Python :: simple python program for beginners 
Python :: django action when create model 
Python :: keras transfer learning 
Python :: class method in python 
Python :: telegram telethon get new user details 
Python :: pyspark on colab 
Python :: what is serializer in django 
Python :: what is data normalization 
Python :: append element to list py 
Python :: typecasting python 
Python :: Find the path of python executable 
Python :: django 3.2 compatible to python 3.10? 
Python :: describe in python 
Python :: TRY 
Python :: configuring static files in django 
Python :: cast as float python 
Python :: python string to uppercase 
Python :: django search 
Python :: all string methods in python 
Python :: Ignoring invalid distribution -ip (c:python310libsite-packages) 
Python :: iloc[:,0:-1] 
Python :: python tuple operations 
Python :: deque python 
Python :: oops python self and making an object of a class and calling function 
Python :: flask page 
Python :: python how to check if string is empty 
Python :: how to make a letter capital in python 
Python :: sys.argv python example 
Python :: save python pptx in colab 
Python :: using pickle to create binary files 
ADD CONTENT
Topic
Content
Source link
Name
6+9 =