Skip to content
Advertisement

Tag: dataframe

Dataframe: shifting values over columns

I have a dataframe with some NaN values in my s_x columns. If NaN values exist in them, I want them to be in the last columns. Example: Given values in the s_x columns of [Nan, 1, Nan, 2] I want the values to shift left over the columns to result in [1, 2, NaN, NaN] Example 2: My current

Advertisement