-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaggregation.py
More file actions
18 lines (14 loc) · 773 Bytes
/
aggregation.py
File metadata and controls
18 lines (14 loc) · 773 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
"""
This is for encode and decode data so that the data can store by Solidity in smart contracts.
"""
def encode(pp):
result = pp.age_quantile + "#" + pp.hemoglobin + "#" + pp.platelets + "#" + pp.MPV + "#" + pp.RBC + \
"#" + pp.lymphocytes + "#" + pp.MCHC + "#" + pp.leukocytes + "#" + pp.basophils + "#" + pp.MCH + \
"#" + pp.eosinophils + "#" + pp.MCV + "#" + pp.monocytes + "#" + pp.RDW + \
"#" + str(pp.detection_coronaviridae) + "#" + str(pp.detection_orthomyxoviridae) + \
"#" + str(pp.detection_paramyxoviridae) + "#" + str(pp.detection_picornaviridae) + \
"#" + str(pp.detection_pneumoviridae)
return result
def decode(aggregation):
result = aggregation.split('#')
return result