0

I have schools and classes to analyze % of students succeed exams. If I do so the output is series of multi indexes. But I need a dataframe from this as an output.

df.groupby(["school","class"]).passed_or_not.value_counts(normalize=True)*100
3
  • so need .reset_index() ? Commented Jun 10, 2022 at 9:58
  • where on this current code? Commented Jun 10, 2022 at 10:00
  • to end of your code. Commented Jun 10, 2022 at 10:00

1 Answer 1

1
df.groupby(["school", "class"]).passed_or_not.value_counts(normalize=True)*100.reset_index(name='share')
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.