0
$\begingroup$

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

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

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.

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

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

$\endgroup$
0

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