数据集:大学毕业生收入

数据集:大学毕业生收入

下载地址,本文以绘制直方图为主。

1. 字段描述

字段名称 字段类型 字段说明
Major_code 整型 专业代码。
Major 字符型 专业名称。
Major_category 字符型 专业所属目录。
Total 整型 总人数。
Employed 整型 就业人数。
Employed_full_time_year_round 整型 全年全职在岗人数。
Unemployed 整型 失业人数。
Unemployment_rate 浮点型 失业率。
Median 整型 收入的中位数。
P25th 整型 收入的25百分位数。
P75th 浮点型 收入的75百分位数。

2. 数据预处理

2.1 导包

import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import os
import warnings
warnings.filterwarnings('ignore')

2.2 读取数据

df = pd.read_csv('大学毕业生收入数据集.csv')

3. 数据预览

3.1 预览数据

print(df.head())

结果

Major_code                                  Major  ...  P25th    P75th
0        1100                    GENERAL AGRICULTURE  ...  34000  80000.0
1        1101  AGRICULTURE PRODUCTION AND MANAGEMENT  ...  36000  80000.0
2        1102                 AGRICULTURAL ECONOMICS  ...  40000  98000.0
3        1103                        ANIMAL SCIENCES  ...  30000  72000.0
4        1104                           FOOD SCIENCE  ...  38500  90000.0

3.2 查看基本信息

df.info()

结果

RangeIndex: 173 entries, 0 to 172
Data columns (total 11 columns):
 #   Column                         Non-Null Count  Dtype  
---  ------                         --------------  -----  
 0   Major_code                     173 non-null    int64  
 1   Major                          173 non-null    object 
 2   Major_category                 173 non-null    object 
 3   Total                          173 non-null    int64  
 4   Employed                       173 non-null    int64  
 5   Employed_full_time_year_round  173 non-null    int64  
 6   Unemployed                     173 non-null    int64  
 7   Unemployment_rate              173 non-null    float64
 8   Median                         173 non-null    int64  
 9   P25th                          173 non-null    int64  
 10  P75th                          173 non-null    float64
dtypes: float64(2), int64(7), object(2)

3.3 查看重复值

print(df.duplicated().sum())

结果

0

3.4 查看缺失值

print(df.isnull().sum())

结果

Major_code                       0
Major                            0
Major_category                   0
Total                            0
Employed                         0
Employed_full_time_year_round    0
Unemployed                       0
Unemployment_rate                0
Median                           0
P25th                            0
P75th                            0
dtype: int64

4. 数据集描述性信息

describe = df.describe()
print(describe)

结果

Major_code         Total  ...         P25th          P75th
count   173.000000  1.730000e+02  ...    173.000000     173.000000
mean   3879.815029  2.302566e+05  ...  38697.109827   82506.358382
std    1687.753140  4.220685e+05  ...   9414.524761   20805.330126
min    1100.000000  2.396000e+03  ...  24900.000000   45800.000000
25%    2403.000000  2.428000e+04  ...  32000.000000   70000.000000
50%    3608.000000  7.579100e+04  ...  36000.000000   80000.000000
75%    5503.000000  2.057630e+05  ...  42000.000000   95000.000000
max    6403.000000  3.123510e+06  ...  78000.000000  210000.000000

[8 rows x 9 columns]

可在变量视图中查看describe

5. 数据分析

5.1 各专业种类(Major_category)的专业分支个数

Major_category_counts=df['Major_category'].value_counts()
print(Major_category_counts)
rects = plt.bar(range(1,17),Major_category_counts);
for rect in rects:  #rects 是三根柱子的集合
    height = rect.get_height()
    plt.text(rect.get_x() + rect.get_width() / 2, height, str(height), size=12, ha='center', va='bottom')
interval = ['Engineering','Education','Humanities & Liberal Arts','Biology & Life Science','Business','Health','Computers & Mathematics',
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

DeeGLMath

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值