I have a merged df which has 2 experiment IDs - experiment_a and experiment_b
They are in the general nomenclature EXPT_YEAR_NUM but some have add ons, of do not have a year instead of some other value. In this df where there is a value in experiment_a, experiment_b = NaN, and vice versa.
ie:
experiment_a experiment_b
EXPT_2011_06 NaN
NaN EXPT_2011_07
How do I sort so that the ascending values of experiment_a and _b are together, instead of it ascending on experiment_a with _b having all NaN values, then ascending with experiment_b when experiment_a have NaN values?
This is what happens when i use sort_values:
df = df.sort_values(['experiment_a', 'experiment_b'])
It clearly just sorts _a first, then _b.