Advertisement
Guest User

Untitled

a guest
Jan 18th, 2019
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.64 KB | None | 0 0
  1. >>> stackme2
  2. State Country group1_a1 group1_b2 Test group2_a1 group2_b2
  3. 0 TX US 0.45 0.3 Test1 2 6
  4. 1 MA US 0.03 1.2 Test2 9 7
  5. 2 ON CAN 0.70 4.2 Test3 4 2
  6. >>>
  7. >>> i = ['State', 'Country', 'Test']
  8. >>> pd.wide_to_long(stackme2, stubnames=stubnames, i=i, j=j, sep='_', suffix=suffix)
  9. group1 group2
  10. State Country Test a-b-Label
  11. TX US Test1 a1 0.45 2
  12. b2 0.30 6
  13. MA US Test2 a1 0.03 9
  14. b2 1.20 7
  15. ON CAN Test3 a1 0.70 4
  16. b2 4.20 2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement