refactoring
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import pandas as pd
|
||||
import numpy as np
|
||||
from Utils import fillLsts
|
||||
|
||||
class SymptomByBatchcodeTableFactory:
|
||||
|
||||
@@ -73,9 +74,3 @@ class SymptomByBatchcodeTableFactory:
|
||||
.dropna()
|
||||
.to_frame(name = symptomColumn)
|
||||
.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