官术网_书友最值得收藏!

Computing descriptive statistics

In this section, we will review methods for obtaining descriptive statistics from data that is stored in a pandas DataFrame. We will use the pandas library to compute statistics from the data. So, let's jump right in!

DataFrames come equipped with many methods for computing common descriptive statistics for the data they contain. This is one of the advantages of storing data in DataFrames—working with data stored this way is easy. Getting common descriptive statistics, such as the mean, the median, the standard deviation, and more, is easy for data that is present in DataFrames. There are methods that can be called in order to quickly compute each of these. We will review several of these methods now.

If you want a basic set of descriptive statistics, just to get a sense of the contents of the DataFrame, consider using the describe() method. It includes the mean, standard deviation, an account of how much data there is, and the five-number summary built in.

Sometimes, the statistic that you want isn't a built-in DataFrame method. In this case, you will write a function that works for a pandas series, and then apply that function to each column using the apply() method.

主站蜘蛛池模板: 桐城市| 盈江县| 壶关县| 贵港市| 留坝县| 彰武县| 名山县| 屏东市| 会宁县| 重庆市| 航空| 永和县| 友谊县| 舞钢市| 神农架林区| 北辰区| 东乌| 台南县| 大连市| 宁国市| 凤山市| 北京市| 克拉玛依市| 南投市| 浪卡子县| 松桃| 凤冈县| 英德市| 福贡县| 胶州市| 邯郸县| 日喀则市| 长汀县| 洪洞县| 乃东县| 正镶白旗| 民丰县| 长岛县| 彭水| 铅山县| 阿合奇县|