Challenge: Screen Compounds Against Target Properties
Swipe to start coding
Write a function rank_candidates that takes a pandas DataFrame with two columns: smiles (molecular SMILES strings) and predicted_activity (numerical scores). Your function should:
- Sort the DataFrame by
predicted_activityin descending order; - Assign a new column
rankwith integer ranks (1 for highest score, 2 for next, etc.); - Return the ranked DataFrame with the new
rankcolumn included.
You should not modify the input DataFrame in-place; return a new DataFrame.
Løsning
Takk for tilbakemeldingene dine!
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
Can you explain this in simpler terms?
What are the main points I should remember?
Can you give me an example?
Fantastisk!
Completion rate forbedret til 6.25
Challenge: Screen Compounds Against Target Properties
Sveip for å vise menyen
Swipe to start coding
Write a function rank_candidates that takes a pandas DataFrame with two columns: smiles (molecular SMILES strings) and predicted_activity (numerical scores). Your function should:
- Sort the DataFrame by
predicted_activityin descending order; - Assign a new column
rankwith integer ranks (1 for highest score, 2 for next, etc.); - Return the ranked DataFrame with the new
rankcolumn included.
You should not modify the input DataFrame in-place; return a new DataFrame.
Løsning
Takk for tilbakemeldingene dine!
single