This commit is contained in:
Steve L. Nyemba -- The Architect 2018-10-01 13:17:50 -05:00
parent 886230e647
commit 8807a4ef49
1 changed files with 17 additions and 17 deletions

View File

@ -72,20 +72,20 @@ class deid :
return r return r
import pandas as pd # import pandas as pd
import numpy as np # import numpy as np
from io import StringIO # from io import StringIO
csv = """ # csv = """
id,sex,age,profession,drug_test # id,sex,age,profession,drug_test
1,M,37,doctor,- # 1,M,37,doctor,-
2,F,28,doctor,+ # 2,F,28,doctor,+
3,M,37,doctor,- # 3,M,37,doctor,-
4,M,28,doctor,+ # 4,M,28,doctor,+
5,M,28,doctor,- # 5,M,28,doctor,-
6,M,37,doctor,- # 6,M,37,doctor,-
""" # """
f = StringIO() # f = StringIO()
f.write(unicode(csv)) # f.write(unicode(csv))
f.seek(0) # f.seek(0)
df = pd.read_csv(f) # df = pd.read_csv(f)
print df.deid.risk(id='id',num_runs=1) # print df.deid.risk(id='id',num_runs=2)