2 Posted by8 months ago
Documentation. What I do wrong? 5 comments 100% Upvoted Log in or sign up to leave a comment Log InSign Up level 1 · 8 mo. ago This method is available directly on TimedeltaArray, TimedeltaIndex and on Series containing timedelta values under the .dt namespace Do you have datetime values or timedelta values. https://pandas.pydata.org/docs/reference/api/pandas.Series.dt.total_seconds.html 1
level 2 Op · 8 mo. ago ohh I see. I tried to do after
1 level 2 Op · 8 mo. ago I have a string how do I convert it to duration?
mm : ss . millisecond > ss . millisecond 1 Continue this thread AttributeError: 'Series' object has no attribute 'days'Asked 26-03-2022 python 0 AttributeError: 'Series' object has no attribute 'days' Share a link to this questionLink Copied!Copy link
khyativermaasked 26-03-2022 2 Answers
0 change:
To
Share a link to this questionLink Copied!Copy link
khyativermaanswered 26-03-2022 0 use the following code.
Share a link to this questionLink Copied!Copy link
khyativermaanswered 26-03-2022 You need to login first then you can post Your Answer Log in Sign up View Discussion Improve Article Save Article View Discussion Improve Article Save Article
Example #1: Use
Output
: Now we will use
Output : As we can see in the output, the Series.dt.day
attribute has successfully accessed and returned the day of the datetime in the underlying data of the given series object.Example #2 : Use Series.dt.day attribute to return the day of the datetime in the underlying data of the given Series object.
Output : Now we will use
Output : As we can see in the output, the Series.dt.day attribute has successfully accessed and returned the day of the datetime in the underlying data of the given series object. |