Challenge: Grouped Summary Table
Swipe to start coding
Given a DataFrame with columns 'experiment', 'group', and 'score', create a function that returns a new DataFrame showing the mean and standard deviation of 'score' for each combination of 'experiment' and 'group'. The resulting DataFrame should have a multi-level index with 'experiment' and 'group'.
- Group the input DataFrame by the
'experiment'and'group'columns. - Calculate the mean and standard deviation of the
'score'column for each group. - Return a new DataFrame with the results, using a multi-level index of
'experiment'and'group'.
Ratkaisu
Kiitos palautteestasi!
single
Kysy tekoälyä
Kysy tekoälyä
Kysy mitä tahansa tai kokeile jotakin ehdotetuista kysymyksistä aloittaaksesi keskustelumme
Can you explain this in simpler terms?
What are the main benefits or drawbacks?
Can you give me a real-world example?
Mahtavaa!
Completion arvosana parantunut arvoon 5
Challenge: Grouped Summary Table
Pyyhkäise näyttääksesi valikon
Swipe to start coding
Given a DataFrame with columns 'experiment', 'group', and 'score', create a function that returns a new DataFrame showing the mean and standard deviation of 'score' for each combination of 'experiment' and 'group'. The resulting DataFrame should have a multi-level index with 'experiment' and 'group'.
- Group the input DataFrame by the
'experiment'and'group'columns. - Calculate the mean and standard deviation of the
'score'column for each group. - Return a new DataFrame with the results, using a multi-level index of
'experiment'and'group'.
Ratkaisu
Kiitos palautteestasi!
single