Python smart stats