0

I have 2 arrays like:

['16.37.235.200','17.37.235.200','16.37.235.200', '18.37.235.200']
['17.37.235.200','17.37.235.200','16.37.235.200', '17.37.235.200']

And I want to map (injective) every IP address to an integer value.
Like for that instance above, eg.:

[0,1,0,3]
[1,1,0,1] 

Is their an existing function (of NumPy or anything else) for that?

3
  • Existing functionality in what? Are you looking specifically at Python since you mentioned numpy? Commented Oct 5, 2018 at 15:48
  • Oh yeah sorry, forgot to mention its in python. Commented Oct 5, 2018 at 16:00
  • could you elaborate more for the mapping process. for eg: if ip :16.37.235.200 is mapped to 0 , what is the ip corresponding to digit 2 Commented Oct 6, 2018 at 8:48

1 Answer 1

0

Ok i found this solution for seperate mapping of the lists Python Map List of Strings to Integer List

Works like i want for seperated mapping of the 2 lists.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.