Linked Questions

703 votes
6 answers
1.8m views

I have a pandas DataFrame and I want to delete rows from it where the length of the string in a particular column is greater than 2. I expect to be able to do this (per this answer): df[(len(df['...
sjs's user avatar
  • 9,380
12 votes
3 answers
29k views

I have a pandas dataframe with duplicate ids. Below is my dataframe id nbr type count 7 21 High 4 7 21 Low 6 8 39 High 2 8 39 Low 3 9 13 High ...
Ashwin Jayarama's user avatar
7 votes
2 answers
3k views

I have a pandas dataframe which looks like this (but is actaully much bigger): a b c d e f g h i j 0| 0 1 2 3 4 -500 -500 5 ...
Vivien's user avatar
  • 73
0 votes
1 answer
9k views

I have a DataFrame that has a column (AE) that could contain: nothing (""), "X", "A" or "E". I want to drop all the rows that have the value "X" on it....
Hélio dos Santos's user avatar
2 votes
1 answer
3k views

df.review: de la nada mi ya no se escucha I tried to set it up It is a good product The aim is to remove non-English rows. I tried this and this but none work. The below code label all the rows as ...
SaNa's user avatar
  • 343
0 votes
1 answer
2k views

I have a dataframe that looks like this Year Season 2000 Winter 2002 Winter 2002 Summer 2004 Summer 2006 Winter and I want to be able to remove all the rows with Winter ...
tarasewiczregan's user avatar
-1 votes
1 answer
3k views

sorry friend I have a dataframe in panda, I have a column that it has a value="Total" in some rows. I want to delete the rows which has "Total" value in it. before this stage I ...
Va SA's user avatar
  • 233
1 vote
1 answer
2k views

I've started learning pandas and have found an issue which I can't seem to resolve. I am loading a data from a csv file and need to delete some rows matching a few strings. CSV: id fullname city tst ...
CaioT's user avatar
  • 2,241
0 votes
2 answers
739 views

I have a large csv file and it contains repeated rows, I want to delete all these repeated rows, containing word "Names" 1 Names Dates Picture 2 Alex 6-12 4364.jpg 3 Names Dates ...
WarHoax's user avatar
  • 23
2 votes
1 answer
1k views

I have a dataset and I want to delete rows from the dataframe based on 2 or column values of that row . For example - I have data frame about all the TV Shows in US , and I need to delete the a ...
jinsi's user avatar
  • 133
0 votes
2 answers
885 views

I am trying to drop certain rows from a CSV file, but not by its label. I need to drop rows with certain values. In this csv file, how would I drop every row with categroy == Physics?
gandalfos's user avatar
0 votes
4 answers
313 views

user_id user_verified 1 False 2 False 3 False 4 True 5 False 6 True How to remove all the 'False'values and keep '...
Tenzin Thinley's user avatar
-2 votes
1 answer
488 views

There has a dataframe, one column, e.g., 'cost', have some zero/empty entries, I would like to keep the rows whose 'cost' column are not zero/empty. How to do it in Pandas?
user288609's user avatar
  • 13.2k
0 votes
1 answer
111 views

I have a column called key_resp_5_rt and in it I would like to remove any rows that are under 300ms (it is a reaction time column) for filename in files: try: df=pd.read_csv(filename) df['...
abc_95's user avatar
  • 179
0 votes
2 answers
110 views

The code seems to run without issue but when I run .describe the values are still there. What am I doing wrong? I am trying to delete -999 values in my dataframe for all the columns with : cols=['#...
lifemannequin's user avatar

15 30 50 per page
1
2 3 4 5