eliminated some hardcoded values
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
def preprocess_loan_charges_data(data):
|
||||
"""
|
||||
Preprocesses the data into a dictionary for efficient lookups by 'code'.
|
||||
|
||||
Args:
|
||||
data: A list of dictionaries.
|
||||
|
||||
Returns:
|
||||
A dictionary where keys are 'code' values and values are the corresponding dictionaries from the input data.
|
||||
If multiple items have the same code, the last one encountered will be stored.
|
||||
"""
|
||||
preprocessed = {}
|
||||
for item in data:
|
||||
if 'code' in item:
|
||||
preprocessed[item['code']] = item
|
||||
return preprocessed
|
||||
Reference in New Issue
Block a user