Given an array I find the following is too slow:
df.loc[:, columns_subset] = array
Then, I imporve the speed but with more codes: