-
Notifications
You must be signed in to change notification settings - Fork 0
/
decrease_jawline_data.py
executable file
·111 lines (94 loc) · 3.44 KB
/
decrease_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]
dec_jaw_data = pd.read_excel('Final Project\Decrease Jawline.xlsx')
# index of each category
#gender
female = dec_jaw_data[dec_jaw_data[gender] == 'Female'].index.tolist()
male = dec_jaw_data[dec_jaw_data[gender] == 'Male'].index.tolist()
other = [i for i in range(len(dec_jaw_data.index)) if i not in female if i not in male]
#dict of category: rating for each
dec_jaw_female = {c:[] for c in columns}
dec_jaw_male = {c:[] for c in columns}
dec_jaw_other = {c:[] for c in columns}
for c in columns:
for f in female:
dec_jaw_female[c].append(dec_jaw_data.loc[f][c])
for m in male:
dec_jaw_male[c].append(dec_jaw_data.loc[m][c])
for o in other:
dec_jaw_other[c].append(dec_jaw_data.loc[o][c])
#ethnicity
white = dec_jaw_data[dec_jaw_data[ethnicity] == 'White'].index.tolist()
black = dec_jaw_data[dec_jaw_data[ethnicity] == 'Black'].index.tolist()
hispanic = dec_jaw_data[dec_jaw_data[ethnicity] == 'Hispanic'].index.tolist()
asian = dec_jaw_data[dec_jaw_data[ethnicity] == 'Asian'].index.tolist()
other_ethnicity = [i for i in range(len(dec_jaw_data.index)) if i not in white if i not in black if i not in hispanic if i not in asian]
dec_jaw_white = {c:[] for c in columns}
dec_jaw_black = {c:[] for c in columns}
dec_jaw_hispanic = {c:[] for c in columns}
dec_jaw_asian = {c:[] for c in columns}
dec_jaw_other_eth = {c:[] for c in columns}
for c in columns:
for w in white:
dec_jaw_white[c].append(dec_jaw_data.loc[w][c])
for b in black:
dec_jaw_black[c].append(dec_jaw_data.loc[b][c])
for h in hispanic:
dec_jaw_hispanic[c].append(dec_jaw_data.loc[h][c])
for a in asian:
dec_jaw_asian[c].append(dec_jaw_data.loc[a][c])
for e in other_ethnicity:
dec_jaw_other_eth[c].append(dec_jaw_data.loc[e][c])
#sexual preference
hetero = dec_jaw_data[dec_jaw_data[so] == 'Heterosexual'].index.tolist()
homo = dec_jaw_data[dec_jaw_data[so] == 'Homosexual'].index.tolist()
bi = dec_jaw_data[dec_jaw_data[so] == 'Bisexual'].index.tolist()
ace = dec_jaw_data[(dec_jaw_data[so] == 'Asexual') & (dec_jaw_data[so] == 'Aromantic')].index.tolist()
other_so = [i for i in range(len(dec_jaw_data.index)) if i not in hetero if i not in homo if i not in bi if i not in ace]
dec_jaw_hetero = {c:[] for c in columns}
dec_jaw_homo = {c:[] for c in columns}
dec_jaw_bi = {c:[] for c in columns}
dec_jaw_ace = {c:[] for c in columns}
dec_jaw_other_so = {c:[] for c in columns}
for c in columns:
for h in hetero:
dec_jaw_hetero[c].append(dec_jaw_data.loc[h][c])
for o in homo:
dec_jaw_homo[c].append(dec_jaw_data.loc[o][c])
for b in bi:
dec_jaw_bi[c].append(dec_jaw_data.loc[b][c])
for a in ace:
dec_jaw_ace[c].append(dec_jaw_data.loc[a][c])
for e in other_so:
dec_jaw_other_so[c].append(dec_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
'''