Since the data appears in an alternating pattern, we can conceptualize the transformation in 2 steps.
Step 1:
Go from
a,a,a b,b,b
For
a,a,a,b,b,b
Step 2: flush redundant columns.
The following solution applies reshape to values DataFrame; arguments for change: (-1, df.shape[1] * 2) , which says: "Give me a frame that has twice as many columns and as many rows as you can manage.
Then I ran the column indexes for the filter: [0, 1, 4, 5] based on your data layout. The resulting numpy array has 4 columns, so we pass it to the DataFrame constructor along with the correct column names.
This is an unreadable solution that depends on the df layout and creates the columns in the wrong order;
import pandas as pd df = pd.DataFrame({'Place' : ['A', 'A', 'B', 'B', 'C', 'C'], 'Var' : ['All', 'French', 'All', 'German', 'All', 'Spanish'], 'Values' : [250, 30, 120, 12, 200, 112]}) df = pd.DataFrame(df.values.reshape(-1, df.shape[1] * 2)[:,[0,1,4,5]], columns = ['Place', 'All', 'Value', 'Language'])