# 加载并查看wage1.csv数据集
import pandas as pd
# 加载数据
= pd.read_csv("data/wage1.csv")
wage1_data
# 查看数据集的前几行和列名
wage1_data.head(), wage1_data.columns
( wage educ exper tenure nonwhite female married numdep smsa \
0 3.10 11 2 0 0 1 0 2 1
1 3.24 12 22 2 0 1 1 3 1
2 3.00 11 2 0 0 0 0 2 0
3 6.00 8 44 28 0 0 1 0 1
4 5.30 12 7 2 0 0 1 1 0
northcen ... trcommpu trade services profserv profocc clerocc \
0 0 ... 0 0 0 0 0 0
1 0 ... 0 0 1 0 0 0
2 0 ... 0 1 0 0 0 0
3 0 ... 0 0 0 0 0 1
4 0 ... 0 0 0 0 0 0
servocc lwage expersq tenursq
0 0 1.131402 4 0
1 1 1.175573 484 4
2 0 1.098612 4 0
3 0 1.791759 1936 784
4 0 1.667707 49 4
[5 rows x 24 columns],
Index(['wage', 'educ', 'exper', 'tenure', 'nonwhite', 'female', 'married',
'numdep', 'smsa', 'northcen', 'south', 'west', 'construc', 'ndurman',
'trcommpu', 'trade', 'services', 'profserv', 'profocc', 'clerocc',
'servocc', 'lwage', 'expersq', 'tenursq'],
dtype='object'))