2 ms·
I use R predominantly, so forgive the lack of adequate Python-ese. Is this behavior because numpy overloads the multiplication operation with a string as strin
by iaw 11y ago
I use R predominantly, so forgive the lack of adequate Python-ese.
Is this behavior because numpy overloads the multiplication operation with a string as string repetition and then implicitly casts the float64 down to an integer of 3? I'm curious why this behavior manifests. When I get a chance I'll test 'xyz'*np.float(3.5)
- lmm 11y agoIt's "normal" in python for this to work with integers: >>> "x" * 3 xxx The only weird part (and it's not that weird IMO) is that numpy's "float" can be implicitly coerced to integer.