Given a DataFrame like this:
import pandas as pd
import numpy as np
df = pd.DataFrame({'A': np.ones(5), 'B': np.zeros(5), 'C': np.ones(5), 'D': np.zeros(5)})
I want to be able to randomly select a number of rows where the A and B value along with their corresponding C and D values - BUT NOT column E and F are - switched so that the B column value is put in the A column and vice versa.
So it's not the whole row, but only certain columns that should switch (A, B, C , D) while E and F keep their values.
Does anybody have any ideas on how to accomplish this?