-
Notifications
You must be signed in to change notification settings - Fork 0
/
increase_jawline_data.py
executable file
·111 lines (94 loc) · 3.51 KB
/
increase_jawline_data.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
###IMPORTS####
# import xlrd
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
#columns
gender = 'Gender'
ethnicity = 'Ethnicity'
so = 'Sexual Preference'
c1 = 'white male'
c2 = 'asian female'
c3 = 'white female'
c4 = 'black female'
c5 = 'latino male'
c6 = 'black male'
c7 = 'asian male'
c8 = 'latina female'
columns = [c1,c2,c3,c4,c5,c6,c7,c8]
incr_jaw_data = pd.read_excel('Final Project\Increase Jawline.xlsx')
# index of each category
#gender
female = incr_jaw_data[incr_jaw_data[gender] == 'Female'].index.tolist()
male = incr_jaw_data[incr_jaw_data[gender] == 'Male'].index.tolist()
other = [i for i in range(len(incr_jaw_data.index)) if i not in female if i not in male]
#dict of category: rating for each
incr_jaw_female = {c:[] for c in columns}
incr_jaw_male = {c:[] for c in columns}
incr_jaw_other = {c:[] for c in columns}
for c in columns:
for f in female:
incr_jaw_female[c].append(incr_jaw_data.loc[f][c])
for m in male:
incr_jaw_male[c].append(incr_jaw_data.loc[m][c])
for o in other:
incr_jaw_other[c].append(incr_jaw_data.loc[o][c])
#ethnicity
white = incr_jaw_data[incr_jaw_data[ethnicity] == 'White'].index.tolist()
black = incr_jaw_data[incr_jaw_data[ethnicity] == 'Black'].index.tolist()
hispanic = incr_jaw_data[incr_jaw_data[ethnicity] == 'Hispanic'].index.tolist()
asian = incr_jaw_data[incr_jaw_data[ethnicity] == 'Asian'].index.tolist()
other_ethnicity = [i for i in range(len(incr_jaw_data.index)) if i not in white if i not in black if i not in hispanic if i not in asian]
incr_jaw_white = {c:[] for c in columns}
incr_jaw_black = {c:[] for c in columns}
incr_jaw_hispanic = {c:[] for c in columns}
incr_jaw_asian = {c:[] for c in columns}
incr_jaw_other_eth = {c:[] for c in columns}
for c in columns:
for w in white:
incr_jaw_white[c].append(incr_jaw_data.loc[w][c])
for b in black:
incr_jaw_black[c].append(incr_jaw_data.loc[b][c])
for h in hispanic:
incr_jaw_hispanic[c].append(incr_jaw_data.loc[h][c])
for a in asian:
incr_jaw_asian[c].append(incr_jaw_data.loc[a][c])
for e in other_ethnicity:
incr_jaw_other_eth[c].append(incr_jaw_data.loc[e][c])
#sexual preference
hetero = incr_jaw_data[incr_jaw_data[so] == 'Heterosexual'].index.tolist()
homo = incr_jaw_data[incr_jaw_data[so] == 'Homosexual'].index.tolist()
bi = incr_jaw_data[incr_jaw_data[so] == 'Bisexual'].index.tolist()
ace = incr_jaw_data[(incr_jaw_data[so] == 'Asexual') & (incr_jaw_data[so] == 'Aromantic')].index.tolist()
other_so = [i for i in range(len(incr_jaw_data.index)) if i not in hetero if i not in homo if i not in bi if i not in ace]
incr_jaw_hetero = {c:[] for c in columns}
incr_jaw_homo = {c:[] for c in columns}
incr_jaw_bi = {c:[] for c in columns}
incr_jaw_ace = {c:[] for c in columns}
incr_jaw_other_so = {c:[] for c in columns}
for c in columns:
for h in hetero:
incr_jaw_hetero[c].append(incr_jaw_data.loc[h][c])
for o in homo:
incr_jaw_homo[c].append(incr_jaw_data.loc[o][c])
for b in bi:
incr_jaw_bi[c].append(incr_jaw_data.loc[b][c])
for a in ace:
incr_jaw_ace[c].append(incr_jaw_data.loc[a][c])
for e in other_so:
incr_jaw_other_so[c].append(incr_jaw_data.loc[e][c])
'''
control_female
control_male
control_others
control_white
control_black
control_asian
control_hispanic
control_other_eth
control_hetero
control_homo
control_bi
control_ace
control_other_so
'''