fraud-detection-handbook
fraud-detection-handbook copied to clipboard
Add iloc for indexing when getting terminal ID
The line:
transactions_df[transactions_df.TX_FRAUD==1].TERMINAL_ID.iloc[0]
Fails if the transaction with an index of 0
within transactions_df
is not identified as fraudulent.
I also updated the code from transactions_df.TX_FRAUD==0
to transactions_df.TX_FRAUD==1
to reflect the text and changed the output to the correct value of 3059
.
The following cell used the correct TERMINAL_ID
of 3059
, so no further changes were required.