Pycharm not show out put in the case of Numpy (Google colab show)

Question:

enter image description here

In the case of the pycharm, it doesn’t show any output.

I used "print()" already. But, Pycharm is showing the <numpy.vectorize object at 0x0000022CF6EDDFA0>.

Asked By: Gaido g

||

Answers:

"aa" in your code is a vectorized function object.

Like any other function or object, when you do print(aa), you aren’t calling it. Similarly, if you write print(len), you get basic description of the function len: <built-in function len>. In order to actually call it, it needs to be followed by brackets. For example: print(len('hello'))

In your code, you probably need print( aa([1,2,3,4], 2) )

Answered By: idiot
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.