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

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:

主站蜘蛛池模板: 忻城县| 右玉县| 山西省| 汉寿县| 昆明市| 新宾| 罗平县| 西峡县| 余干县| 安溪县| 辽宁省| 景东| 万宁市| 宿迁市| 泽州县| 沂源县| 通河县| 沧州市| 临颍县| 剑河县| 娄烦县| 唐河县| 永川市| 张掖市| 侯马市| 萨迦县| 安庆市| 榆中县| 上饶县| 榆中县| 忻城县| 辉县市| 揭阳市| 自治县| 哈密市| 盐亭县| 镇安县| 道孚县| 双柏县| 玉林市| 屯留县|