I'm trying to make a transformation rubik's cube like (see I/O below) :
# INPUT :
COLX COLY COLZ
0 A C NaN
1 C B A
2 C NaN B
# OUTPUT :
COLX COLY COLZ
0 A Missing C
1 A B C
2 Missing B C
Basically, I need to sort the values of each row alphabetically.
Here is the dataframe I'm using :
import pandas as pd
import numpy as np
df = pd.DataFrame({'COLX': ['A', 'C', 'C'], 'COLY': ['C', 'B', np.nan] , 'COLZ': [np.nan, 'A', 'B']})
Is there any propositions ?
Should I use pandas.DataFrame.shift ? If so, how to proceed, please ?