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,150 points

edited Jun 9 by MD 771 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 by MD

Related Questions In Data Analytics

0 votes
1 answer

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,290 points
13,011 views
0 votes
0 answers
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
67 views
0 votes
1 answer
+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, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 1,056 views
0 votes
0 answers
+4 votes
6 answers
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 by MD 798 views