unstack a multiindex dataframe
<p>I  want to unstack a multi-index dataframe, which looks like this:</p>

<p><a href="https://i.stack.imgur.com/DARpN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DARpN.png" alt="original dataframe"></a></p>

<p>into another dataframe whose <strong>index is 'Worker_id', column names are 'Task_id' and values are 'Date_cnt'.</strong></p>

<p>Could someone give a help?</p>

<p>I've tried df.unstack, but it automatically puts 'Date_cnt',rather than 'Task_id' as column names</p>

<p>Thanks!</p>