Apply method with reduce result_type

Report a typo

You are given a custom function, sum_row(), the result of which is the sum of the first and second columns divided by 10.5.

Complete the solution() function, which accepts a pandas dataframe as an argument. Use the .apply() method with the sum_row() function and use result_type=reduce in the resulting dataframe. The output must be a reduced column (axis=1).

Store the result in the df variable and don't remove the print() statement.

Write a program in Python 3
def sum_row(row):
return (row[0] + row[1]) / 10.5

def solution(df):
print(df)
___

Create a free account to access the full topic