0

I have written code as below:

 import datetime as dt
d = dt.date(2000, 1, 15) 

But I am getting an error:

AttributeError                            Traceback (most recent call last)
<ipython-input-23-669287944c85> in <module>
  1 # for loop - to convert float->str date to month-year format
  2 rnum = 0
----> 3 d = dt.date(2000, 1, 15)
  4 data_2["Date_F"] = d
  5 for dt in data_2["strDate"]:
AttributeError: 'str' object has no attribute 'date'

I am using Jupyter. Please tell me how to resolve this error.

1 Answers1

0

dont know why you are getting this. I am getting output like datetime.date(2000, 1, 15) You may check your indentation or something.

Agog
  • 69
  • 5
  • This does not provide an answer to the question. Once you have sufficient [reputation](https://stackoverflow.com/help/whats-reputation) you will be able to [comment on any post](https://stackoverflow.com/help/privileges/comment); instead, [provide answers that don't require clarification from the asker](https://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can-i-do-instead). - [From Review](/review/late-answers/32245246) – n4321d Jul 20 '22 at 16:33