Is it possible to convert a timestamp object in the format "2016-01-01" (year month day) into number of days from new years?
I'm getting my timestamp object by str(pandas.to_datetime('today')).split(" ")[0]
I would put code that I used to get it started but I don't even know where to begin except by making a dictionary for how many days are in each month and then calculating it the long way. Is there something built in that I can use for this?
datetime.strptime
method and thetimedelta
method would be useful to you – cricket_007 Apr 24 '16 at 0:19datetime
and then converting it withstr()
for some reason, so instead of converting that back todatetime
they can just dispense withstr()
in the first place. – TigerhawkT3 Apr 24 '16 at 0:28