Data sciense, average of rows (data manipulation, 1 lesson)
Hi! I finished all code projects in course, but it doesn't work with 1 lesson called data manipulation. The code works fine, but in 2, 3, 4 tests i conseder i have one additional whitespace in answer besause of the round function. Don't know what to do else, i tryed a lot of different round functions, changed my code a lot, adding to lists, etc. Here is my code (2 different ways): import numpy as np n, p = [int(x) for x in input().split()] arr = np.zeros([n,p], "float") for i in range(n): arr[i, :] = [float(xx) for xx in input().split()] print(arr.mean(axis = 1).round(2)) arr_mean = np.zeros([n], 'float') for i in range(n): m_sum = 0 for j in range(p): m_sum = arr[i, j] + m_sum arr_mean[i] = m_sum/p print(arr_mean.round(2))