How to convert different size array in Pandas, Python / Pyspark



How can i convert below input into mentioned output using Python pd or np ?
i tried a some examples, but it is of same array size.

Emp Dept1 Dept2 Dept3 Marks1 Marks2 Marks3
100 10 20 30 15 25 35

100 10 15
100 20 25
100 30 35

Learn Spark 1.6.x or Spark 2.x on our state of the art big data labs

  • Click here for access to state of the art 13 node Hadoop and Spark Cluster


Refer below screenshot.

Use below link for better understanding.


Thanks, Is there any way to get 100 also 3 times (we got one time). Like my output as mentioned?
I tried but not getting.