-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create educational notebook based on Sargolini 2006 #26
Conversation
simplifying pearson functions and adding a short description at the end
@weiglszonja what still needs to be done with this PR? Is it ready for review? |
@bendichter Adding the cell layer information is missing currently, I checked the file that contains this, should not be hard to match it with the existing data. I can do it this week. |
@bendichter ready for review |
What is the purpose of def pearson_cor_2arr(arr1, arr2):
""" Calculating Pearson correlation for two arrays with the same shape and no NaN."""
if not arr1.shape == arr2.shape:
raise Exception("Both arrays should have the same shape")
n = arr1.shape[0] * arr1.shape[1]
numerator = n * np.sum(arr1 * arr2) - np.sum(arr1) * np.sum(arr2)
denominator = (n * np.sum(arr1**2) - np.sum(arr1)**2)**0.5 * (n * np.sum(arr2**2) - np.sum(arr2)**2)**0.5
return numerator / denominator I think this should be the same as |
You're right, the arrays just have to be flattened, I don't remember why we didn't use |
looks good to me. @bendichter do you give your blessing ? then please click big green button! |
@weiglszonja - sorry, missed the question. Don't remember, why I created the function on my own, perhaps had some issues with the scipy function or wanted to compare. we can check if this gives the same results now. |
@djarecka no worries, I checked already. |
@weiglszonja @bendichter Any updated on this? Is this ready? |
@CodyCBakerPhD This is good to go from my side, but I don't have permission to merge. |
Developer Days Project