drop

Drop a row or observation by condition

Drop a row or observation by condition Question: Let’s assume we have a dataframe df(1200, 20). Since I am only interested in 2 columns in the I will use only these in the following example index A B 1 Alex George 2 Paul Patrick 3 A.S. Nick 3 Alice Dave I am interested in dropping …

Total answers: 1

Different ways to conditional Drop Row in Pandas

Different ways to conditional Drop Row in Pandas Question: 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. I searched nad I have found 2 ways of doing it: df= df.drop(df[df.AE == …

Total answers: 1

Extracting/deleting rows from time series without using index information

Extracting/deleting rows from time series without using index information Question: I have a simple problem. I want to get a subset of time series with a certain condition that is not dependent on time index. I have a very huge dataset, I am just giving a small example to make my problem understandable. row_num marks …

Total answers: 1

Remove top row from a dataframe

Remove top row from a dataframe Question: I have a dataframe that looks like this: level_0 level_1 Repo Averages for 27 Jul 2018 0 Business Date Instrument Ccy 1 27/07/2018 GC_AUSTRIA_SUB_10YR EUR 2 27/07/2018 R_RAGB_1.15_10/18 EUR 3 27/07/2018 R_RAGB_4.35_03/19 EUR 4 27/07/2018 R_RAGB_1.95_06/19 EUR I am trying to get rid of the top row and …

Total answers: 5

Drop rows containing empty cells from a pandas DataFrame

Drop rows containing empty cells from a pandas DataFrame Question: I have a pd.DataFrame that was created by parsing some excel spreadsheets. A column of which has empty cells. For example, below is the output for the frequency of that column, 32320 records have missing values for Tenant. >>> value_counts(Tenant, normalize=False) 32320 Thunderhead 8170 Big …

Total answers: 8