I have a rather simple question: I want to drop rows from a DataFrame based on a condition. The DataFrame looks something like this:
Program act
Original RO A
Original RO nan
Followup RO B
Followup RO nan
Integral RO nan
I want to delete nulls for Original RO and Integral RO Programs only. So it should look like this:
Program act
Original RO A
Followup RO B
Followup RO nan
I always have problems when trying to do some operations on a portion of my dataframe and keep the rest as is.
I tried this:
df.loc[df.Program.str.match('^(Original|Integral)')] = df.dropna()
But isn't working. What am I doing wrong? Thanks in advance!