I am new to python, I want to sum the certain scores and when I type the code normally, it works perfectly:
select_df = df.filter(like = 'ABC')
select_df = select_df.loc[(df.REF == '000')]
select_df.sum(axis=1)
but when I define a function and try it like this, it is not working:
def sum_score(a, b):
select_df = df.filter(like = a)
select_df = select_df.loc[(df.REF == b)]
select_df.sum(axis=1)
sum_score('ABC', '000')
And when I type it as:
print(sum_score('ABC', '000'))
The output says NONE