Function Hash

Question 1

Create the following functions, and any other auxiliary function you consider necessary, using the functionalities offered by the Numpy library:

• code(item, nbits=10): convert a tuple of strings into an integer in the range [0, 2 b ] where b is the number of bits. You may use the built in function hash(object) .

• vectorize_line(line, k=3, nbits=10): convert a string into a 1 dimensional numpy array of size 2 b . The conversion should be performed as follows: extract all possible sub sequences of k words from the string in input; convert each k- word tuple into an integer using the previous function code ; use the resulting integer p as the position index; count the number of occurrences of the resulting integer in the input line; this is the value in position p in the returned array.

• vectorize_story(story, k=3, nbits=10): convert a story , which is a list of n strings, into a 2 dimensional numpy array of size n × 2 b using vectorize_line .

• convert all stories in text in a list of 2 dimensional numpy arrays and assign it to the variable mtxs .

Question 2

Go online and search for at least THREE (3) companies that are considered great places to work. Describe the compensation, benefits and perks at each of these companies.

Of the three, which is most appealing to you and why?

Need help with this assignment or a similar one? Place your order and leave the rest to our experts!

Quality Assured!

Always on Time

Done from Scratch.