How to cycle the NaNs in pandas dataframe rows?

I have a dataframe like this: How to put all the NAs in the left instead of right? Required: Answer There are mixed numeric with strings rows, so solution is use sorted with key parameter in DataFrame.apply: If all values are numeric, faster solution is with justify: