1
$\begingroup$

My Dataset is looking like this

Input dataset

I would like to get the output something like this.

Output dataset I need to group by date and find the occurrences if each feedback. In this case, i have 5 feedback types (namely 5,4,3,2,1)

$\endgroup$
1
  • 1
    $\begingroup$ df.groupby(['Date', 'Feedback']).size().unstack() $\endgroup$ Apr 11, 2019 at 17:44

1 Answer 1

1
$\begingroup$

This can work:

import pandas as pd
import numpy as np

unstacked_df = stacked_df.unstack()

The next time you post, you could post a reproducible code so we could help you a little more.

$\endgroup$
1
  • $\begingroup$ The unstack function has arguments such as level, etc., you may work with this information. $\endgroup$ Apr 11, 2019 at 14:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.