I have a dataframe like this
|Class ID| Student ID||English| Maths|Science|
|:------:|:---------:|:------:|:----:|:-----:|
|    1   |     101   |  Pass  | Fail |  Pass |
|    1   |     102   |  Fail  | Pass |  Pass |
|    1   |     103   |  Pass  | Fail |  Fail |
|    1   |     104   |  Pass  | Pass |  Fail |
|    2   |     101   |  Fail  | Fail |  Pass |
|    2   |     102   |  Fail  | Pass |  Pass |
|    2   |     103   |  Fail  | Fail |  Fail |
|    2   |     104   |  Pass  | Pass |  Fail |
I want a output like this
|Class ID| Subjects|Pass|Fail|
|:------:|:-------:|:--:|:--:|
|    1   | English |  3 |  1 |
|    1   | Maths   |  2 |  2 |
|    1   | Science |  2 |  2 |
|    2   | English |  1 |  3 |
|    2   | Maths   |  2 |  2 |
|    2   | Science |  2 |  2 |
Is this possible,
How do I write in python to get this kind of data frame?
 
    