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

edited Jun 9 by MD 830 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,320 points
21,876 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 in Data Analytics by MD
• 80,050 points
37 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
105 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, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 1,580 views
0 votes
0 answers
+4 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,800 points
1,193 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 by MD 874 views