Created
August 28, 2019 20:07
-
-
Save theSekyi/dfb2b86eabd6c902510e34e85e5742f9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def static_features(t0): | |
"""Get features such as current weekday and time | |
""" | |
weekday = t0.dt.dayofweek | |
return weekday | |
t0 = pd.to_datetime('2019-01-07 06:05:00') | |
a = static_features(t0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--------------------------------------------------------------------------- | |
AttributeError Traceback (most recent call last) | |
<ipython-input-267-884bb83e94ca> in <module> | |
----> 1 a = static_features(t0) | |
<ipython-input-265-bf9b2bc64178> in static_features(t0) | |
4 """Get features such as current weekday and time | |
5 """ | |
----> 6 weekday = t0.dt.dayofweek | |
7 | |
8 return weekday | |
AttributeError: 'Timestamp' object has no attribute 'dt' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment