0

I need to convert ID's into hex signed 2's complement.

A sample of the data frame:

osiId
-3839344128100363916
3706509458083282923
-6999440164179221150
-8641005918235945332
-2906403792682509248
1747872771634044177

Tried this but it only works for positive numbers:

df1['osiId'] = df1['osiId'].apply(hex)

Thank you.

  • the `apply()` method lets you apply a function. do you have a function called `hex` ? – D.L Oct 17 '22 at 21:32
  • hex is a built-in python function – Coldshowers Oct 18 '22 at 00:40
  • in that respect, you are asking to convert signed-unsigned integers, so this is your answer https://stackoverflow.com/questions/20766813/how-to-convert-signed-to-unsigned-integer-in-python – D.L Oct 18 '22 at 01:07

0 Answers0