python - AttributeError: 'TimedeltaProperties' object has no attribute 'years' in Pandas -
in pandas, why timedeltaproperties
object have no attribute 'years'?
after all, datetime
object has property.
it seems natural thing object concerned time have. if has hours, seconds, etc attribute.
is there workaround column, full of values like
10060 days
,
can converted years? or better yet, converted integer representation years?
timedeltaproperties
not have year
or month
attributes because according timedeltaproperties source code . -
accessor object datetimelike properties of series values.
but , months
or years
have no constant definition.
1 month
can take on different different number of days, based on month
itself, january -> 31 days , april -> 30 days , etc.
1 month
can take on different values based on year (in case of february month) , if year 2004 , february has 29 days , if year 2003 february has 28 days, etc.
same case years
, can take on different values based on exact year is, example - if year 2003 , has 365 days, if year 2004 has 366 days.
hence, requirement - convert 10060 days
years
not accurate, years
?
like stated, accurate amount of years no. of days correspond depend on actual years days represent.
Comments
Post a Comment