1

I am pretty new to Python and pandas library, i just learned how to read a csv file using pandas.

my data is actually raw packets i captured from sensor networks, to analyze corrupt packets.

what i have now is, thousands of rows and hundreds of columns, literally, and the values are all in Hex. i need to convert all the values to binary with trailing zeros.

i am at lost on how to accomplish that once i have read the CSV file successfully using pandas.

I'd appreciate every kind of help, even a simple direction.

here is my sample data:

00 FF FF 00 00 29 00 89 29 41 88 44 22 00 FF FF 01 00 3F 06 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 0A

00 FF FF 00 00 29 00 89 29 41 88 45 22 00 FF FF 01 00 3F 06 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 0A

00 FF FF 00 00 29 00 89 29 41 88 46 22 00 FF FF 01 00 3F 06 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 0A

00 FF FF 00 00 29 00 89 29 41 88 47 22 00 FF FF 01 00 3F 06 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 0A

EdChum
  • 376,765
  • 198
  • 813
  • 562
Moosa
  • 11
  • 2

1 Answers1

0

If I understood, in column 1 you have 00, column 2 : 55, ...

If I am right, you first need to concat three columns in a string value = str(col1)+str(col2)+str(col3) and then use the method to convert it in binary.

maeVeyable
  • 152
  • 4