Hi guys im just a rookie in python (even in programming) so my question might sound very basic but i have a hard time to understand this.
Why is the selective behavi
Not sure if this is the reason but my guess is:
What if your objects were instances of your own homemade class? Numpy cannot do anything else but hope that you have defined a sqrt method in your class and let it do the work. So I assume that's what it does here, but in your case your objects are floats, and although np.sqrt(some_random_float) makes sense, some_random_float.sqrt() doesn't because the AttributeError: 'float' object has no attribute 'sqrt'.
Typically numpy is designed and optimized for numerical computations, while using it with generic dtype=object can be sometime convenient, you shouldn't assume everything will always run seamlessly in this case...