[python] invalid literal for int() with base 16 error handling.

Asked 2 years ago, Updated 2 years ago, 16 views

Data Type: DataFrame

data["nom_5"] = int(str(data["nom_5"].values),16)

Error: invalid literal for int() with base 16: "[50f116bcf', 'b3b4d25d0', '3263bdce5' ... '488406659' 'f9d17bb93'\n 'a5c276589']"

"['50f116bcf' 'b3b4d25d0' '3263bdce5' ... '488406659' 'f9d17bb93'\n 'a5c276589']" This data["nom_5"] value.

I'm tying it up here in error.

python

2022-09-22 11:08

1 Answers

int("['50f116bcf' 'b3b4d25d0' '3263bdce5' ... '488406659' 'f9d17bb93'\n 'a5c276589']", 16)

If you do, the same error will occur. It's such a natural error.

"['50f116bcf' 'b3b4d25d0' '3263bdce5' ... '488406659' 'f9d17bb93'\n 'a5c276589']"The entire string is not hexadecimal.


2022-09-22 11:08

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.