Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting following issue while running count_visitors.py #2

Open
sagarlakshmipathy opened this issue Aug 21, 2019 · 1 comment
Open

Comments

@sagarlakshmipathy
Copy link

apples-MacBook-Air:analytics_pipeline vidhyasagar$ python count_visitors.py
Traceback (most recent call last):
File "count_visitors.py", line 40, in
day = time_obj.strftime("%d-%m-%Y")
AttributeError: 'str' object has no attribute 'strftime'

@sparkey667
Copy link

sparkey667 commented Oct 16, 2019

The issue when I got it was that when you go through thee for loop, the last time_obj in the list happens to be a string type instead of a datetime type. I ended up adding these lines prior to it as a temporary work around:

if type(time_obj) != datetime:
continue
day = time_obj.strftime("%d-%m-%Y")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants