-
Notifications
You must be signed in to change notification settings - Fork 0
/
RestrictedData.py
41 lines (30 loc) · 1.22 KB
/
RestrictedData.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
from pandas import DataFrame
from pandas import Series
import MaclearnUtilities
import NormalizedData
xs = NormalizedData.xs
xnorms = NormalizedData.xnorms
annots = NormalizedData.annots
patelSubtype = annots['patel'].SubType
patelKeepers = ((patelSubtype == 'subtype: Mes') |
(patelSubtype == 'subtype: Pro'))
patelKeepers = annots['patel'].index[patelKeepers]
xs['patel'] = xs['patel'].ix[patelKeepers]
xnorms['patel'] = xnorms['patel'].ix[patelKeepers]
annots['patel'] = annots['patel'].ix[patelKeepers]
montastierTime = annots['montastier'].Time
montastierKeepers = ((montastierTime == 'C1') |
(montastierTime == 'C2'))
xs['montastier'] = xs['montastier'].ix[montastierKeepers]
xnorms['montastier'] = xnorms['montastier'].ix[montastierKeepers]
annots['montastier'] = annots['montastier'].ix[montastierKeepers]
## -----------------------------------------------------------------
## extract ys
## -----------------------------------------------------------------
ys = {
'shen' : annots['shen'].Nervous,
'patel' : annots['patel'].SubType,
'montastier' : annots['montastier'].Time,
'hess' : annots['hess'].pCRtxt
}
ynums = {k : MaclearnUtilities.safeFactorize(ys[k]) for k in ys}