added median to stats.py

2nd pull request attempt.