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

pyspark

#1

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.

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

Output:
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


#2

@srini1981
Refer below screenshot.

Use below link for better understanding.
https://pandas.pydata.org/pandas-docs/stable/advanced.html


#3

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.