Challenge: Implement Compliance Flags
Swipe to start coding
Given a DataFrame of transactions, you need to identify which transactions should be flagged for compliance review. A transaction should be flagged if its amount is greater than $10,000 or if its country is in the provided list of high-risk countries. You must add a new column called compliance_flag to the DataFrame, indicating with True or False whether each transaction is flagged. After updating the DataFrame, print a summary statement showing how many transactions were flagged out of the total.
Conceptual steps:
- Add a
compliance_flagcolumn to the DataFrame. - Set
compliance_flagtoTruefor transactions where the amount is greater than $10,000 or the country is in the high-risk list. - Set
compliance_flagtoFalsefor all other transactions. - Print a summary statement showing the number of flagged transactions and the total number of transactions.
Lösung
Danke für Ihr Feedback!
single
Fragen Sie AI
Fragen Sie AI
Fragen Sie alles oder probieren Sie eine der vorgeschlagenen Fragen, um unser Gespräch zu beginnen
Can you explain this in simpler terms?
What are the main takeaways from this?
Can you give me an example?
Großartig!
Completion Rate verbessert auf 4.76
Challenge: Implement Compliance Flags
Swipe um das Menü anzuzeigen
Swipe to start coding
Given a DataFrame of transactions, you need to identify which transactions should be flagged for compliance review. A transaction should be flagged if its amount is greater than $10,000 or if its country is in the provided list of high-risk countries. You must add a new column called compliance_flag to the DataFrame, indicating with True or False whether each transaction is flagged. After updating the DataFrame, print a summary statement showing how many transactions were flagged out of the total.
Conceptual steps:
- Add a
compliance_flagcolumn to the DataFrame. - Set
compliance_flagtoTruefor transactions where the amount is greater than $10,000 or the country is in the high-risk list. - Set
compliance_flagtoFalsefor all other transactions. - Print a summary statement showing the number of flagged transactions and the total number of transactions.
Lösung
Danke für Ihr Feedback!
single