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

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.

主站蜘蛛池模板: 平和县| 长岛县| 城步| 拜城县| 广西| 盐边县| 巴南区| 石泉县| 拜城县| 道孚县| 平南县| 集安市| 辛集市| 普安县| 崇义县| 星座| 台南市| 沭阳县| 吴堡县| 西城区| 房产| 都匀市| 昭通市| 清苑县| 邵阳县| 托里县| 讷河市| 康定县| 高要市| 安乡县| 蓬安县| 年辖:市辖区| 咸丰县| 淅川县| 黄陵县| 陇南市| 崇信县| 汕尾市| 钦州市| 栾城县| 贡山|