[Tutor] Fwd: How to roughly associate the values of two numpy arrays, or python lists if necessary

Alan Gauld alan.gauld at btinternet.com
Wed Sep 19 16:01:19 EDT 2018


Forwarded to list....

----------------------------

I have, I suspect, an elementary problem that I am too inexperienced to 
resolve.

I have two numpy arrays, each representing the values of a specific 
property of a set of cells.

Now, I want to associate the two values for each cell, that is for each 
index of the numpy array. But I want to associate them ROUGHLY, that 
means, APPROXIMATELY, so that there is a weak, linear correlation 
between the values representing one property and the values representing 
the second property of each individual cell.

Up to now I have used the following procedure.
I have divided each population of values into four segments based on the 
value of the standard deviation thus.

1. values > mean + 1 std (sigma)
2. values > mean but < mean + 1 std (sigma)
3. values < mean but > mean + 1 std (sigma)
4. values < mean + 1 std (sigma).

Then I randomly select a value from group 1 for the first property and I 
associate it with a randomly selected sample of the second property from 
its group 1. And so on through the total population. This gave me a very 
rough linear association between the two properties, but I am wondering 
whether I can do it in a simpler and better way.


-- 

Sydney


_________

Professor Sydney Shall
Department of Haematology/Oncology
Phone: +(0)2078489200
E-Mail: sydney.shall
[Correspondents outside the College should add @kcl.ac.uk]



More information about the Tutor mailing list