refactoring
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
import pandas as pd
|
import pandas as pd
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
from Utils import fillLsts
|
||||||
|
|
||||||
class SymptomByBatchcodeTableFactory:
|
class SymptomByBatchcodeTableFactory:
|
||||||
|
|
||||||
@@ -73,9 +74,3 @@ class SymptomByBatchcodeTableFactory:
|
|||||||
.dropna()
|
.dropna()
|
||||||
.to_frame(name = symptomColumn)
|
.to_frame(name = symptomColumn)
|
||||||
.reset_index())
|
.reset_index())
|
||||||
|
|
||||||
def fillLsts(lsts, desiredLen, fillValue):
|
|
||||||
return [fillLst(lst, desiredLen, fillValue) for lst in lsts]
|
|
||||||
|
|
||||||
def fillLst(lst, desiredLen, fillValue):
|
|
||||||
return lst + [fillValue] * (max(desiredLen - len(lst), 0))
|
|
||||||
6
src/Utils.py
Normal file
6
src/Utils.py
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
def fillLsts(lsts, desiredLen, fillValue):
|
||||||
|
return [fillLst(lst, desiredLen, fillValue) for lst in lsts]
|
||||||
|
|
||||||
|
|
||||||
|
def fillLst(lst, desiredLen, fillValue):
|
||||||
|
return lst + [fillValue] * (max(desiredLen - len(lst), 0))
|
||||||
Reference in New Issue
Block a user