I have a pandas dataframe that looks like this, and repeats for about 10k rows:
Lbl # Value Time
16 160 0-00-000-0000-0000-0000-0000-00 000:00:00:00.206948
17 270 0-00-000-0000-0001-1010-0110-00 000:00:00:00.212948
18 271 1-00-000-0000-0000-0110-1110-00 000:00:00:00.215828
19 272 0-00-001-1000-0111-1111-1000-00 000:00:00:00.218708
20 273 1-00-000-0000-0000-0111-1110-00 000:00:00:00.221588
21 274 0-00-000-0000-0000-1001-0110-00 000:00:00:00.224468
22 275 0-00-001-1111-0000-0000-0000-00 000:00:00:00.227348
23 276 1-00-000-0000-0000-0000-0000-00 000:00:00:00.233428
24 277 0-00-000-0000-0000-0000-0000-00 000:00:00:00.236308
29 334 0-11-000-0000-0000-0000-0000-00 000:00:00:00.253900
63 160 0-00-000-0000-0000-0000-0000-00 000:00:00:00.458692
How do I go into each 'Value' label and break it up into the 24 corresponding bits. End game is to be able to graph Label 160, Bit 19 over the course of the datafile, along with some other analysis.
Thanks.
Edit: The answer from MaxU worked. Just for future visitors, the final code I ended up with is:
df_bits = df_binary.Value.str.replace('-','').str.extractall('(\d)').unstack().astype(np.int8).add_prefix('b')
df_binary = pd.concat([df_binary, df_bits], axis = 1)