相关文章推荐
小眼睛的热带鱼  ·  Python equivalent of ...·  2 周前    · 
俊逸的火锅  ·  Python 控制台 — Blender ...·  2 周前    · 
健身的抽屉  ·  在 Google Cloud 上使用 ...·  2 周前    · 
直爽的黑框眼镜  ·  Difference between ...·  1 周前    · 
慷慨大方的手术刀  ·  python ...·  1 年前    · 
爱旅游的盒饭  ·  PyPDF2 ...·  1 年前    · 
睡不着的山楂  ·  TortoiseGit ...·  2 年前    · 
豪情万千的芹菜  ·  HttpContent.ReadAsStri ...·  2 年前    · 
Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

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))
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.

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.