【赵渝强老师】利用Python完成数据分布特征的分析

【赵渝强老师】利用Python完成数据分布特征的分析

在对数据质量进行分析后,可以对数据的特征进行分析和计算,还可以通过图表显示数据的特征。采用分布分析、比较分析、统计分析、周期分析、贡献分析(帕累托分析)、相关分析、正态检验等方法对数据进行特征分析。

[En]

After the analysis of the quality of the data, the characteristics of the data can be analyzed and calculated, and the characteristics of the data can also be displayed by drawing charts. The characteristics of data are analyzed in the following ways: distribution analysis, comparative analysis, statistical analysis, periodic analysis, contribution analysis (Pareto analysis), correlation analysis, normality test.

分布分析可以揭示数据的分布特征和类型。

[En]

Distribution analysis can reveal the distribution characteristics and types of data.

  • 对于定量数据,想要了解其分布形式是对称的还是非对称的,发现某些特大或特小的可以值,可以通过绘制频率分布直方图、茎叶图进行直观分析;
  • 对于定性数据,可用饼图和条形图直观的显示分布情况。

下面我们用具体的例子来演示如何分析数据的定量和定性分布。以下是您需要使用的测试数据。这是1998年全年数码相机的销售订单数据。以下是排名前10位的数据:

[En]

Below we use specific examples to demonstrate how to analyze the quantitative and qualitative distribution of data. Here are the test data you need to use. This is the sales order data for digital cameras for the whole year of 1998. Here are the top 10 pieces of data:

【赵渝强老师】利用Python完成数据分布特征的分析
  • 对于定量数据分析

对数据进行定量分析,展示其分布情况最常用的方法就是直方图(Histogram)。这种图又称质量分布图,是一种统计报告图,由一系列高度不等的纵向条纹或线段表示数据分布的情况。一般用横轴表示数据类型,纵轴表示分布情况。

通常可以按照以下步骤绘制直方图:

[En]

You can generally follow these steps to draw a histogram:

  1. 求极差。针对同一指标,极差越大,数据越不稳定
  2. 分组数据,并决定分点
  3. 绘制频率分布直方表
  4. 绘制频率分布直方图

【赵渝强老师】利用Python完成数据分布特征的分析

绘制的直方图如下所示。

[En]

The histogram drawn is as follows.

【赵渝强老师】利用Python完成数据分布特征的分析
  • 对于定性数据分析

数据的定性分析往往按照变量的分类类型进行分组,最常用的表示其分布的方法是用饼图或条形图来描述定性变量的分布。例如,饼图显示数据系列中项目大小与项目总和的比率。饼图中的数据点显示为整个饼图的百分比。

[En]

The qualitative analysis of data is often grouped according to the classification type of variables, and the most commonly used method to show its distribution is pie chart or bar chart to describe the distribution of qualitative variables. For example, a pie chart shows the ratio of the size of items in a data series to the sum of items. The data points in the pie chart are displayed as a percentage of the entire pie chart.

【赵渝强老师】利用Python完成数据分布特征的分析

下面以饼图举例说明,只需要将上面直方图代码中最后生成的DataFrame(result)直接使用饼图绘制出,即可。如下所示。

【赵渝强老师】利用Python完成数据分布特征的分析

绘制出的饼图如下所示。

【赵渝强老师】利用Python完成数据分布特征的分析

Original: https://www.cnblogs.com/collen7788/p/15593893.html
Author: 赵渝强老师
Title: 【赵渝强老师】利用Python完成数据分布特征的分析

原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/510696/

转载文章受原作者版权保护。转载请注明原作者出处!

(0)

大家都在看

亲爱的 Coder【最近整理,可免费获取】👉 最新必读书单  | 👏 面试题下载  | 🌎 免费的AI知识星球