Skip to content

Instantly share code, notes, and snippets.

@tuantmb
Created November 20, 2022 17:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tuantmb/d86b748d15d41a822fa3de9ddaa50a5f to your computer and use it in GitHub Desktop.
Save tuantmb/d86b748d15d41a822fa3de9ddaa50a5f to your computer and use it in GitHub Desktop.
just test numpy
n, p = [int(x) for x in input().split()]
import numpy as np
output = np.array([])
for i in range(n):
values = np.array([float(y) for y in input().split()][:p])
// np.array.mean() vs round(np.array.sum(), 2) --> number of decimal values after the point
s = values.sum()
m = round(s / p, 2)
output = np.append(output, m)
print(output)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment