I need your kind suggestions with a table creation.
I have a table that looks like this.
| Month | Department | Total Expenditure |
|---|---|---|
| Jan-18 | DOJ | 625000 |
| Jan-18 | DOJ | 975000 |
| Jan-18 | DOJ | 650000 |
| Jan-18 | DOJ | 625000 |
| Jan-18 | DOJ | 975000 |
| Jan-18 | DOJ | 650000 |
| Jan-18 | DOJ | 625000 |
| Jan-18 | DOJ | 975000 |
| Jan-18 | DOJ | 650000 |
| Jan-18 | DOJ | 625000 |
| Jan-18 | DOJ | 975000 |
| Jan-18 | DOJ | 650000 |
| Feb-18 | DOJ | 625000 |
| Feb-18 | DOJ | 975000 |
| Feb-18 | DOJ | 650000 |
| Feb-18 | DOJ | 625000 |
| Feb-18 | DOJ | 975000 |
| Feb-18 | DOJ | 650000 |
| Feb-18 | DOJ | 625000 |
| Feb-18 | DOJ | 975000 |
| Feb-18 | DOJ | 650000 |
And this goes on till May-22 for DOJ and 12 other departments.
I cannot pivot this table, because having duplicates in the first column where the date is missing Tableau will add the numbers up, and Python will throw an error such as
ValueError: Index contains duplicate entries, cannot reshape
Every month has 12 entries only (12 days a month). I want to add numbers 1 to 12 at the beginning of each Month column so the entries have a unique ID that i can use for df1.pivot(index='Month',columns='Department', values='Total Expenditure Estimate')
The new table should look like
| Month | Department | Total Expenditure |
|---|---|---|
| 1-Jan-18 | DOJ | 625000 |
| 2-Jan-18 | DOJ | 975000 |
| 3-Jan-18 | DOJ | 650000 |
| 4-Jan-18 | DOJ | 625000 |
| 5-Jan-18 | DOJ | 975000 |
| 6-Jan-18 | DOJ | 650000 |
| 7-Jan-18 | DOJ | 625000 |
| 8-Jan-18 | DOJ | 975000 |
| 9-Jan-18 | DOJ | 650000 |
| 10-Jan-18 | DOJ | 625000 |
| 11-Jan-18 | DOJ | 975000 |
| 12-Jan-18 | DOJ | 650000 |
| 1-Feb-18 | DOJ | 625000 |
| 2-Feb-18 | DOJ | 975000 |
| 3-Feb-18 | DOJ | 650000 |
| 4-Feb-18 | DOJ | 625000 |
| 5-Feb-18 | DOJ | 975000 |
| 6-Feb-18 | DOJ | 650000 |
| 7-Feb-18 | DOJ | 625000 |
| 8-Feb-18 | DOJ | 975000 |
| 9-Feb-18 | DOJ | 650000 |
| 10-Feb-18 | DOJ | 650000 |
| 11-Feb-18 | DOJ | 650000 |
| 12-Feb-18 | DOJ | 650000 |
I will appreciate your kind suggestions. Please kindly help me out and advise how to fix this column. Thank you in advance.