I have a Dataframe that looks like (e.g.) this:
print(df)
date high low close
0 2008-01-01 15.540 15.540 15.54
1 2008-01-02 15.750 15.210 15.25
2 2008-01-03 15.450 14.950 15.02
3 2008-01-04 14.990 14.400 14.48
4 2008-01-05 14.890 14.400 14.78
5 2008-01-06 14.890 14.400 14.78
....
I would like to remove the rows from the Dataframe whose date column contains a weekend date.
date high low close
0 2008-01-01 15.540 15.540 15.54
1 2008-01-02 15.750 15.210 15.25
2 2008-01-03 15.450 14.950 15.02
3 2008-01-04 14.990 14.400 14.48
4 <-- has been removed since 1/05/2008 is a Saturday
5 <-- has been removed since 1/06/2008 is a Sunday
....
I tried this:
df = df[~df.date.dt.weekday_name.isin(['Saturday','Sunday']).any(0)]
but it doesn't work.
