You are viewing a single comment's thread. Return to all comments →
I assume this is the line you are talking about - print(int(stats.mode(numbers)[0]))
Given a list of numbers [1, 1, 1, 2, 2], the mode method in stats package has an output like this:
ModeResult(mode=array([1]), count=array([4]))
the print method asks to output the first array in an integer form.
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 →
I assume this is the line you are talking about - print(int(stats.mode(numbers)[0]))
Given a list of numbers [1, 1, 1, 2, 2], the mode method in stats package has an output like this:
ModeResult(mode=array([1]), count=array([4]))
the print method asks to output the first array in an integer form.