79640167

Date: 2025-05-27 09:26:49
Score: 1
Natty:
Report link

Your code is working fine. Just need simple modification.

def cashflow_series(ch1=1, ch2=2):
    return {0: ch1, 0.5: ch2, 1: 7, 2: 8, 3: 9}

df = df.assign(cashflows=lambda x: x.apply(lambda row: cashflow_series(ch1=row['Characteristic1'], ch2=row['Characteristic3']), axis=1))

print(df.to_string())
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Muideen