I try to select every Friday in the daily stock price data frame. I read and tried the sentence in this link , in particular:
Fridays = df[df.index.weekday == 4]
but I get the following error:
AttributeError: 'Index' object has no attribute 'weekday'
<class 'pandas.core.frame.DataFrame'>
I believe the problem is that Python does not recognize rows in the index as dates, but I cannot understand why. DataFrame is as follows:
1993-04-08 3387.83
1993-04-12 3420.79
Any help is appreciated.
source
share