-
-
Notifications
You must be signed in to change notification settings - Fork 776
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
02-numpy: clarify numpy.diff() part #777
02-numpy: clarify numpy.diff() part #777
Conversation
Using a variable called `npdiff` to hold an array is highly confusing, given that the function to be learned here is called {numpy,np}.diff(). Also, stress that the array returned by `diff()` is shorter by one.
Thanks, Steve. I agree with your reasoning and like the changes you make to the text. I wonder, though, if Anyway, thanks for the pull request! |
Hi Steve, I agree with Maxim--I like the clarifications your edits contribute to the text but would prefer to avoid the short variable name |
Rename variable `a` -> `row_start` and add text relating that to the `data` array encountered earlier. The text part about "patient data is _longitudinal_" is redundant since that answers the question posed later regarding the usage of the `axis` keyword. It intoduces the usage of `axis`, while the following intro to diff() first uses a 1d array.
Valid points regarding |
Thanks, Steve. I had the same concern as Lauren so I'm glad you reverted that change. In any case, a question to both of you: what if we name our variable |
I didn't do that since the original example uses an artificial 1d array of length 5 (enough for explaining what |
I am ok with using |
|
If @elcorto wants to modify the exercise to reflect the actual patient data and further blend the exercise into the lesson as you suggest @maxim-belkin, I think that would be great, otherwise, I think it is ok to merge as-is and further blend it in a separate PR. |
Agreed. |
Unfortunately, I won't have time to improve this episode more for now in the way you outlined. However, I found other issues that I hope to fix in later PRs. As for this PR, I don't have any pending changes to add. |
* 02-numpy: clarify numpy.diff() part Using a variable called `npdiff` to hold an array is highly confusing, given that the function to be learned here is called {numpy,np}.diff(). Also, stress that the array returned by `diff()` is shorter by one. * 02-numpy: diff(): rename variable, streamline text Rename variable `a` -> `row_start` and add text relating that to the `data` array encountered earlier. The text part about "patient data is _longitudinal_" is redundant since that answers the question posed later regarding the usage of the `axis` keyword. It intoduces the usage of `axis`, while the following intro to diff() first uses a 1d array. * 02-numpy: diff(): Re-add introduction lines
Using a variable called
npdiff
to hold an array is highly confusing,given that the function to be learned here is called {numpy,np}.diff().
Also, stress that the array returned by
diff()
is shorter by one.