I am doing basic data analysis on an csv file in jupyter notebook

def answer_two():
    return (df['Gold']-df['Gold.1']).argmax()

The above code snippet is to subtract two columns of the dataframe.I am expecting an answer in the form of a country name but I am getting the following output.

<function __main__.answer_two>

I am unable to figure out why this is happening .Occasionally ,the required output in the form of country name is coming but not running it everytime.


closed as off-topic by Stephen Rauch, Icyblade, Kiritee Gak, timleathart, oW_ Jan 4 '18 at 23:09

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question does not appear to be about data science, within the scope defined in the help center." – Stephen Rauch, Icyblade, Kiritee Gak, timleathart, oW_
If this question can be reworded to fit the rules in the help center, please edit the question.

  • $\begingroup$ answer_two() not answer_two $\endgroup$ – oW_ Jan 4 '18 at 23:09

Instead of calling answer_two, call answer_two(). you are referring to the function object now. You have to call the function.


Not the answer you're looking for? Browse other questions tagged or ask your own question.