How to delete DataFrame row in pandas based upon a column value

0 votes

I have Following DataFrame:

I want to remove the row, how?

May 3, 2018 in Data Analytics by DataKing99
• 8,250 points

edited Jun 9, 2020 by MD 1,622 views

1 answer to this question.

0 votes

You can use drop function in your code.

data.drop(index=2,axis=0,inplace=True)
Distance Price
0 2 20.0
1 4 40.0
3 9 90.0
4 10 NaN

You have to provide your Row no. in place of the index parameter.

answered May 3, 2018 by DeepCoder786
• 1,720 points

edited Jun 9, 2020 by MD

Related Questions In Data Analytics

+1 vote
2 answers

How to replace a value in a data frame based on a conditional 'If' statement?

It's easier to convert alpha to characters ...READ MORE

answered Jun 6, 2018 in Data Analytics by Sahiti
• 6,370 points
36,654 views
0 votes
0 answers
0 votes
1 answer

How to add a new column to a Dataframe in R?

Hi@akhtar, You can add new columns to a ...READ MORE

answered Oct 30, 2020 in Data Analytics by MD
• 95,460 points
718 views
0 votes
1 answer

How to change mulitiple characters in a column to a date

Firstly we have to set dataf variable ...READ MORE

answered Apr 3, 2018 in Data Analytics by DeepCoder786
• 1,720 points
774 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,441 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,077 views
0 votes
7 answers
0 votes
1 answer

How to drop rows of Pandas DataFrame whose value in certain coulmns is NaN

Hi@DataKing99, You can create one function according to ...READ MORE

answered May 7, 2018 in Data Analytics by DeepCoder786
• 1,720 points

edited Jun 9, 2020 by MD 1,706 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