SHARE
TWEET

Untitled

a guest Jul 22nd, 2019 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. a = pd.DataFrame([[1,2], [3,4]], columns=[0,1])
  2. b = pd.DataFrame([[5,6], [6,7]], columns=[1,0])
  3.  
  4. a[[0, 1]] = b
  5. print(a)
  6.      
  7. 0  1
  8. 0  5  6
  9. 1  6  7
  10.      
  11. 0  1
  12. 0  6  5
  13. 1  7  6
  14.      
  15. a.loc[:, [0, 1]] = b
  16. print(a)
  17.    0  1
  18. 0  6  5
  19. 1  7  6
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top