-
I want to label a bunch of hex IDs into A/B so that With the code snippet below, I randomly assign a A/B label to hex IDs and the output looks like the map below. Want to know what are other strategies to label hex IDs as A/B. import random
def split_into_ab(hex_id):
return random.randint(1, 2) == 1 |
Beta Was this translation helpful? Give feedback.
Answered by
dfellis
Mar 27, 2021
Replies: 1 comment 4 replies
-
If you want it based on the def split_into_ab(hex_id):
return int(hex_id, 16) % 2 == 1 |
Beta Was this translation helpful? Give feedback.
4 replies
Answer selected by
isaacbrodsky
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you want it based on the
hex_id
and therefore the same every time, what about: