Example: pandas has a Timedelta subclass. I want to get the number of hours from a given Timedelta. I have two options:
-
Show this thread
-
First, break it into components, convert each component to hours, and sum them.
1 reply 0 retweets 8 likesShow this thread -
Or second: divide by a Timedelta representing 1 hour and get a floating point (or an integer!) as my return. This is obviously way less code
1 reply 0 retweets 9 likesShow this thread -
But this is also nonsensical.
2 replies 0 retweets 8 likesShow this thread -
Replying to @EmilyGorcenski
is... it? that sounds like an appropriate use of division
1 reply 0 retweets 3 likes -
-
Replying to @EmilyGorcenski
you want to know how many hours are in this timespan; division means "how many X are in this Y"
2 replies 0 retweets 2 likes -
Replying to @eevee
Ehhh.... division of two Subclasses doesn't make sense. Why should I believe __div__ is even supported?
4 replies 0 retweets 2 likes -
Replying to @EmilyGorcenski @eevee
Mind you, this is not *python's* datetime library, it is a Subclass within a module that doesn't consistently implement such methods.
1 reply 0 retweets 3 likes -
Replying to @EmilyGorcenski
hm, unless it's doing something /extremely/ weird i wouldn't expect it to break base class operations
1 reply 0 retweets 0 likes
(it is doing something extremely weird)
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.