Deleting elements from numpy array

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

retagged Jun 25, 2019 by Kalgi 921 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, 2019 by Fata
• 1,050 points

edited Jun 25, 2019 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, 2019 in Python by Pavan
3,510 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
1,041 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
567 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
1,744 views
0 votes
2 answers
+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 7, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 4,443 views
0 votes
1 answer
+5 votes
6 answers

Lowercase in Python

You can simply the built-in function in ...READ MORE

answered Apr 11, 2018 in Python by hemant
• 5,790 points
4,078 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP