You are viewing a single comment's thread. Return to all comments →
For those getting an error with this code:
import numpy as np from scipy import stats
size = int(input()) numbers = list(map(int, input().split())) print(np.mean(numbers)) print(np.median(numbers)) print(*stats.mode(numbers)[0]))
This unpacks the list element "mode" and prints as an integer value.
Seems like cookies are disabled on this browser, please enable them to open this website
Day 0: Mean, Median, and Mode
You are viewing a single comment's thread. Return to all comments →
For those getting an error with this code:
import numpy as np from scipy import stats
size = int(input()) numbers = list(map(int, input().split())) print(np.mean(numbers)) print(np.median(numbers)) print(*stats.mode(numbers)[0]))
This unpacks the list element "mode" and prints as an integer value.