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'.
Lösning
Tack för dina kommentarer!
single
Fråga AI
Fråga AI
Fråga vad du vill eller prova någon av de föreslagna frågorna för att starta vårt samtal
Can you explain this in simpler terms?
What are the main benefits or drawbacks?
Can you give me a real-world example?
Fantastiskt!
Completion betyg förbättrat till 5
Challenge: Grouped Summary Table
Svep för att visa menyn
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'.
Lösning
Tack för dina kommentarer!
single