Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # The MIT License (MIT)
- #
- # Copyright (c) 2014
- #
- # Permission is hereby granted, free of charge, to any person obtaining a copy
- # of this software and associated documentation files (the "Software"), to deal
- # in the Software without restriction, including without limitation the rights
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- # copies of the Software, and to permit persons to whom the Software is
- # furnished to do so, subject to the following conditions:
- #
- # The above copyright notice and this permission notice shall be included in
- # all copies or substantial portions of the Software.
- #
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- # THE SOFTWARE.
- import numpy
- #top 50
- wpm = [87, 86, 82, 77, 77, 76, 74, 74, 72, 72, 71, 71, 70, 70, 70, 69, 68, 68, 68, 68, 67, 67, 66, 66, 65, 65, 65, 65, 64, 64, 63, 63, 63, 63, 62, 62, 62, 62, 62, 62, 61, 61, 61, 61, 60, 60, 60, 60, 59, 59, ]
- population = 2900
- distribution_range = 29
- # distributes population wpm evenly
- # among distribution_range lower than 59
- # e.g. if distribution_range == 10, population is
- # distributed evenly amongst wpm 49, 50, 51, ... 58
- for i in range(59 - distribution_range,59):
- wpm += [i]*(population/distribution_range)
- def upper_outlier_bound(data):
- return numpy.mean(data) + 3 * numpy.std(data)
- def num_upper_outliers(data):
- uob = upper_outlier_bound(data)
- return sum(1 for d in data if d > uob)
- print "Mean: {0:.1f}\nStandard Deviation: {1:.1f}\nOutlier if WPM > {2:.1f}\n# of Upper Outliers: {3}".format(numpy.mean(wpm), numpy.std(wpm), upper_outlier_bound(wpm), num_upper_outliers(wpm))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement