Open jwu19 opened 2 months ago
I personally did not write the python code and wrote the R version instead, which does not include any cycles. I would imagine that the df['CYCLE'] is referring to a column from the input CSV. There should be an example input CSV file in one of the folders.
i have checked the csv file as attached, but there is no 'cycle' column in the file example_input.csv
OK, would the code work if you inserted a CYCLE column in the file?
Currently I just removed the cycle column from the calculation to make the code work as I do not have the cycle information. This will result in commenting the two-cycle rule code in line 133-140 in rwToT_LoT_line.py as below
# Line is not advanced because two-cycle rule is not met
# elif (next_drug in r_regimen) == False and
(has_eligible_drug_addition == False) and (has_eligible_drug_substition == False) and two_cycles == False: # V.S. 2020/10/01
'CYCLE']]['MED_NAME'].unique()
# drug_dates =
df[df['MED_NAME'].isin(r_regimen)]['MED_START']
# adjusted_line_start = min(drug_dates)
# V.S. 2020/10/01
# line_end_date = max(drug_dates)
# V.S. 2020/10/01
# line_end_reason = "New line started with new drugs"
# V.S. 2020/10/01
# line_next_start = next_drug_date
On Wed, May 15, 2024, 9:18 AM Weilin Meng @.***> wrote:
OK, would the code work if you inserted a CYCLE column in the file?
— Reply to this email directly, view it on GitHub https://github.com/Merck/Line-of-Therapy-Algorithm/issues/6#issuecomment-2112497098, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB532EPB6ILU65MFQG65P5DZCNOBJAVCNFSM6AAAAABG6NS6Y2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMJSGQ4TOMBZHA . You are receiving this because you authored the thread.Message ID: @.***>
In line 141 in rwToT_Lot_line.py, df['CYCLE'] is not defined anywhere before
r_regimen = df[df['CYCLE']==df.loc[i, 'CYCLE']]['MED_NAME'].unique()