I have data in below format:
<table><tbody><tr><th>T_id</th><th>Task_name</th><th>product_id</th></tr><tr><td>1</td><td>A1</td><td>10120</td></tr><tr><td>1</td><td>A2</td><td>10122</td></tr><tr><td>2</td><td>B1</td><td>10111</td></tr><tr><td>2</td><td>B1</td><td>10120</td></tr><tr><td>2</td><td>A1</td><td>10122</td></tr></tbody></table>
I'm able to convert the above format manually using excel in below format
<table><tbody><tr><th>Task_id</th><th> </th><th> </th><th> </th></tr><tr><td>1</td><td>10120</td><td>10122 </td><td> </td></tr><tr><td>2</td><td>10111</td><td>10120</td><td>10122</td></tr></tbody></table>
Can somebody please help me with Python or R program. I have used pivot(), pivot_table() in python & cast, reshape in R. But i couldn't get the required output.