Module to Calculate Statistics
You are working for a prestigious data science company. You receive raw numerical data every day, and your manager wants to analyze this data more closely. They are particularly interested in the mean
, median
, and mode
of each data set.
As the company grows, the manager wants to automate this process, so they have asked you to create a Python module named stats.py
that includes functions to calculate these statistical parameters. That file should include 3 functions mean()
, median()
, and mode()
that should get a list of floating-point numbers as an argument and return a number. In case there are multiple modes with same frequency you should return the smallest one.
The input and output are handled automatically by the main.py
module.
Input | Output |
---|---|
10 2 2 3 5 7 5 7 5 2 2 | Mean: 4.0 Median: 4.0 Mode: 2 |
Constraints
Time limit: 2 seconds
Memory limit: 512 MB
Output limit: 1 MB