-
Notifications
You must be signed in to change notification settings - Fork 0
/
id_assign.py
42 lines (28 loc) · 1.09 KB
/
id_assign.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
"""
Functions for assigning IDs within VertNet processing Script
"""
#===========================================================================================================================================
import uuid
import numpy as np
#===========================================================================================================================================
def assign_indivdual_ID(data):
"""
Add individualID and populate with UUID
"""
data = data.assign(individualID = '')
data['individualID'] = [uuid.uuid4().hex for _ in range(len(data.index))]
return data
def create_id(data):
"""
Create materialSampleID which is a UUID for each measurement,
Create eventID and populate it with materialSampleID
"""
data['materialSampleID'] = [uuid.uuid4().hex for _ in range(len(data.index))]
data["eventID"] = data['materialSampleID']
return data
def diagnostic_id(data):
"""
Create diagnosticID which is a unique number for each measurement
"""
data['diagnosticID'] = np.arange(len(data))
return data