0

I am using pandas day_name() function but its giving attribute error as below:

s = pd.Series(pd.date_range(start='2018-01-01', freq='D', periods=3))
s

0   2018-01-01
1   2018-01-02
2   2018-01-03
dtype: datetime64[ns]
s.dt.day_name()
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-37-75cff12ad412> in <module>()
----> 1 s.dt.day_name()

AttributeError: 'DatetimeProperties' object has no attribute 'day_name'

pandas documentation has the same example. Don't know why it's not working.

FObersteiner
  • 22,500
  • 8
  • 42
  • 72

1 Answers1

0

enter image description here

Worked for me when I tried in my iPython notebook.

Pulkit Jha
  • 1,709
  • 3
  • 12
  • 18
  • https://stackoverflow.com/questions/60214194/error-in-reading-stock-data-datetimeproperties-object-has-no-attribute-week – Pulkit Jha Nov 23 '22 at 08:54