手把手教你用Python求均值、中值和众数
导读:数据科学入门:集中趋势度量——均值、中值和众数。
均值——一组值的平均值; 中值——当所有值按顺序排列时的中间值; 众数——最常出现的值。
grades = [85, 93, 45, 89, 85]
sum(grades) / len(grades)
import statistics
statistics.mean(grades)
statistics.median(grades)
statistics.mode(grades)
sorted(grades)
[45, 85, 85, 89, 93]
[85, 93, 45, 89, 85, 93]
点击上图了解及购买
划重点👇
最新评论
推荐文章
作者最新文章
你可能感兴趣的文章
Copyright Disclaimer: The copyright of contents (including texts, images, videos and audios) posted above belong to the User who shared or the third-party website which the User shared from. If you found your copyright have been infringed, please send a DMCA takedown notice to [email protected]. For more detail of the source, please click on the button "Read Original Post" below. For other communications, please send to [email protected].
版权声明:以上内容为用户推荐收藏至CareerEngine平台,其内容(含文字、图片、视频、音频等)及知识版权均属用户或用户转发自的第三方网站,如涉嫌侵权,请通知[email protected]进行信息删除。如需查看信息来源,请点击“查看原文”。如需洽谈其它事宜,请联系[email protected]。
版权声明:以上内容为用户推荐收藏至CareerEngine平台,其内容(含文字、图片、视频、音频等)及知识版权均属用户或用户转发自的第三方网站,如涉嫌侵权,请通知[email protected]进行信息删除。如需查看信息来源,请点击“查看原文”。如需洽谈其它事宜,请联系[email protected]。