mercredi 27 septembre 2017

Can someone explain how to do numpy correlation matrix?

I have two sets of values ranging from 3-27, that have 20 finite values:

A = [(0,21),(1,12),(2,15),(3,3),(4,21),(5,15),(6,28),(7,21),(8,9),(9,27),(10,12),(11,9),(12,12),(13,3),(14,9),(15,12),(16,6),(17,3),(18,9),(19,15)]

B = [(0,15),(1,3),(2,9),(3,9),(4,6),(5,15),(6,28),(7,21),(8,15),(9,24),(10,9),(11,12),(12,3),(13,12),(14,6),(15,15),(16,6),(17,6),(18,12),(19,18)]

And I have the one that has index/keys that are a reference in place if the first value were set to 0:

Z = [(0,16),(0,16),(2,20),(0,16),(4,28),(0,16),(6,9),(0,16),(0,16),(0,16),(10,11),(11,3),(,(13,8),(16,29)]

I was told that I could create 'bins' for the integers in 'A' and 'B', and I was told I could turn those bins into ranges (-1,+1) for each integer. So I would then create 10 bins '(2,3,4),(5,6,7),(8,9,10),..(26,27,28)'.

I'd like to learn how to do a pattern match of Z over A and B, iterating through both until the most values match the pattern in index/key and integer range and it giving me the number of matches as well as the place in A and B that those matches start.

Could someone teach me how I would do such a thing?

Aucun commentaire:

Enregistrer un commentaire