Comment by ebonnafoux
3 days ago
In the article
> Contrast this with equivalent code that is full of logistics, where I’m using only basic Python language features and no special data wrangling package:
n = len(values)
# Calculate mean
mean = sum(values) / n
# Calculate standard deviation
variance = sum((x - mean) \* 2 for x in values) / (n - 1)
std_dev = math.sqrt(variance)
He doesn' t know about the statistics package in the standart library of Python (https://docs.python.org/3/library/statistics.html). Of course, if you do not know to use Python, you will have a lot of boilerplate.
No comments yet
Contribute on Hacker News ↗