Challenge: Flag Suspicious Transactions
Oppgave
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
Alt var klart?
Takk for tilbakemeldingene dine!
Seksjon 3. Kapittel 3
single
Spør AI
Spør AI
Spør om hva du vil, eller prøv ett av de foreslåtte spørsmålene for å starte chatten vår
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
Sveip for å vise menyen
Oppgave
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
Alt var klart?
Takk for tilbakemeldingene dine!
Seksjon 3. Kapittel 3
single