Deleting elements from numpy array

0 votes
How can i delete 1 item numpy array?
Jun 24 in Python by Nisa
• 1,090 points

retagged Jun 25 by Kalgi 37 views

1 answer to this question.

0 votes
Use the following code:

import numpy as np
a=np.array([1,2,3,4])
b=np.delete(a,2)

OUTPUT:

array([1, 2, 4])
answered Jun 24 by Fata
• 1,040 points

edited Jun 25 by Kalgi

Related Questions In Python

0 votes
1 answer

How to create Pandas series from numpy array?

Hi. Refer to the below command: import pandas ...READ MORE

answered Apr 1 in Python by Pavan
206 views
0 votes
1 answer
+1 vote
2 answers

View onto a numpy array?

 just index it as you normally would. ...READ MORE

answered Oct 18, 2018 in Python by roberto
57 views
0 votes
1 answer

Deleting list elements

Use pop(): a = [1, 2, 3, 4] a.pop(2) print(a) Now ...READ MORE

answered Apr 23, 2018 in Python by Nietzsche's daemon
• 4,260 points
23 views
0 votes
1 answer
0 votes
1 answer

Printing a large numpy array

numpy.set_printoptions(threshold='nan') READ MORE

answered Jul 20, 2018 in Python by Nietzsche's daemon
• 4,260 points
126 views
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 6 in Python by Neha
• 330 points

edited Jul 8 by Kalgi 349 views
+4 votes
6 answers