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

Mathematical operations allowed

At each level, we will describe briefly the type of math that is allowed, and more importantly, not allowed. At this level, we cannot perform any quantitative mathematical operations, such as addition or pision. These would not make any sense. Due to the lack of addition and pision, we obviously cannot find an average value at the nominal level. There is no average name or average job department.

We can, however, do basic counts using pandas' value_counts methods:

# Basic Value Counts of the Grade column
salary_ranges['Grade'].value_counts().head()


00000 61 07450 12 06870 9 07170 9 07420 9 Name: Grade, dtype: int64

The most commonly occurring Grade is 00000, meaning that that is our mode or most commonly occurring category. Because of our ability to count at the nominal level, graphs, like bar charts, are available to us:

# Bar Chart of the Grade column salary_ranges['Grade'].value_counts().sort_values(ascending=False).head(20).plot(kind='bar')

The following is the result of the preceding code:

At the nominal level, we may also utilize pie charts:

# Bar Chart of the Grade column as a pie chart (top 5 values only)
salary_ranges['Grade'].value_counts().sort_values(ascending=False).head(5).plot(kind='pie')

The following is the output of the preceding code:

主站蜘蛛池模板: 河池市| 安徽省| 沙坪坝区| 交口县| 安徽省| 革吉县| 册亨县| 崇州市| 大埔县| 友谊县| 泾源县| 盈江县| 桑植县| 菏泽市| 鄂尔多斯市| 新源县| 宜丰县| 津市市| 奉节县| 留坝县| 绍兴市| 信阳市| 韩城市| 宝丰县| 同德县| 高青县| 聂拉木县| 青海省| 长宁县| 左权县| 湘乡市| 凤庆县| 尉犁县| 湖南省| 呈贡县| 武威市| 长春市| 黑龙江省| 奉新县| 固阳县| 岳普湖县|