Challenge: Flag Suspicious Transactions
Opgave
Swipe to start coding
Given a DataFrame of transactions, your task is to flag suspicious transactions based on the amount column.
- Calculate the mean of the
amountcolumn. - Calculate the standard deviation of the
amountcolumn. - Flag any transaction as suspicious if its amount is more than 2 standard deviations away from the mean.
- Add a new column called
suspiciousto the DataFrame, where each value isTrueif the transaction is suspicious andFalseotherwise. - Return the updated DataFrame.
Løsning
Var alt klart?
Tak for dine kommentarer!
Sektion 3. Kapitel 3
single
Spørg AI
Spørg AI
Spørg om hvad som helst eller prøv et af de foreslåede spørgsmål for at starte vores chat
Suggested prompts:
Can you explain this in simpler terms?
What are the next steps I should take?
Can you provide an example?
Fantastisk!
Completion rate forbedret til 4.76
Challenge: Flag Suspicious Transactions
Stryg for at vise menuen
Opgave
Swipe to start coding
Given a DataFrame of transactions, your task is to flag suspicious transactions based on the amount column.
- Calculate the mean of the
amountcolumn. - Calculate the standard deviation of the
amountcolumn. - Flag any transaction as suspicious if its amount is more than 2 standard deviations away from the mean.
- Add a new column called
suspiciousto the DataFrame, where each value isTrueif the transaction is suspicious andFalseotherwise. - Return the updated DataFrame.
Løsning
Var alt klart?
Tak for dine kommentarer!
Sektion 3. Kapitel 3
single