I have a column like this
col1
(0,0):19,(1,1):155
(0,0):13,(0,1):32,(1,1):34
(0,0):56,(1,0):43,(1,1):38
(0,0):67,(0,1):45,(1,0):98,(1,1):70
and I would like to split it into four columns:
(0,0) (0,1) (1,0) (1,1)
19 0 0 155
13 32 0 34
56 0 43 38
67 45 98 70
I have try col.str.split(',\s*(?![^()]*\))',expand=True) but can only get:
col1 col2 col3 col4
(0,0):19 (1,1):155 NAN NAN
(0,0):13 (0,1):32 (1,1):34 NAN
(0,0):56 (1,0):43 (1,1):38 NAN
(0,0):67 (0,1):45 (1,0):98 (1,1):70
I was wondering if there is a way get what I show above? Thanks a lot!
Kun