-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathutil.py
74 lines (72 loc) · 2.19 KB
/
util.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
def add_extra_rows(df):
rows = [
{
'age': 46,
'fnlwgt': 257473,
'education': 'Bachelors',
'education-num': 8,
'marital-status': 'Married-civ-spouse',
'occupation': 'Plumber',
'relationship': 'Husband',
'race': 'Other',
'sex': 'Male',
'capital-gain': 1000,
'capital-loss': 0,
'hours-per-week': 41,
'native-country': 'Australia',
'label': '>50K'
},
{
'age': 0,
'workclass': 'Private',
'fnlwgt': 257473,
'education': 'Masters',
'education-num': 8,
'marital-status': 'Married-civ-spouse',
'occupation': 'Adm-clerical',
'relationship': 'Wife',
'race': 'Asian',
'sex': 'Female',
'capital-gain': 0,
'capital-loss': 0,
'hours-per-week': 40,
'native-country': 'Pakistan',
'label': '>50K'
},
{
'age': 1000,
'workclass': 'Private',
'fnlwgt': 257473,
'education': 'Masters',
'education-num': 8,
'marital-status': 'Married-civ-spouse',
'occupation': 'Prof-specialty',
'relationship': 'Husband',
'race': 'Black',
'sex': 'Male',
'capital-gain': 0,
'capital-loss': 0,
'hours-per-week': 20,
'native-country': 'Cameroon',
'label': '<=50K'
},
{
'age': 25,
'workclass': '?',
'fnlwgt': 257473,
'education': 'Masters',
'education-num': 8,
'marital-status': 'Married-civ-spouse',
'occupation': 'gamer',
'relationship': 'Husband',
'race': 'Asian',
'sex': 'Female',
'capital-gain': 0,
'capital-loss': 0,
'hours-per-week': 50,
'native-country': 'Mongolia',
'label': '<=50K'
}
]
df = df.append(rows, ignore_index=True)
return df