I have a Pandas DF in the following format:
df:
| Name | Feature | Count |
|---|---|---|
| A | aa | 2 |
| A | bb | 1 |
| B | bb | 3 |
| B | cc | 1 |
| C | dd | 2 |
I would like to transform the DF into something like this:
| Name | Feature aa | Feature bb | Feature cc | Feature dd |
|---|---|---|---|---|
| A | 2 | 1 | 0 | 0 |
| B | 0 | 3 | 1 | 0 |
| C | 0 | 0 | 0 | 2 |
(cells now are counts related to Names and features).
How can I get this result? Please, I need your help.