-
-
Notifications
You must be signed in to change notification settings - Fork 781
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
Use numpy.concatenate instead of hstack, vstack #1009
Comments
It's an interesting point! I think But a note on |
Okay, I see your point. When teaching this material, we had some discussions with the learners about how the data is laid out and what the provided I guess one could argue that the provided representation when printing gives a reasonable intuition for 2D arrays, still this does not straightforwardly generalize to higher dimensions (at least in my head). But I think the compromise you suggest could be okay. Shall I write up a short info box on this? |
That's a good point, the episode goes on to explain the difference between I think your/our suggestion on using |
Great! I will write something up and create a PR. Doesn't have high priority though, so might take a while to arrive. =) |
In fact, |
Hi everybody,
I was just reading through Episode 2 and was surprised about the appearance of
numpy.hstack
andnumpy.vstack
. Isn't it more useful to just introducenumpy.concatenate
with an appropriateaxis
kwarg? I personally never use the{h,v}stack
functions because they lack the generality to handle some cases for higher dimensions (and whenever I did it took me a while to sort out which of the 3, 4 or 5 axes of my array is considered "horizontal"). Even if the tutorial (at least at that point) is only concerned with 2D data, would it hurt to give them the exact same functionality but sneaking in the generality they might need for their own use case? One could even argue that it is simplerAdmittedly, this might be just personal preference (my own as well as of the people I work with), so I would be interested to hear if there are some rational arguments for the current way of doing it. If not, I'm happy to provide this small patch myself.
Best,
Julian
The text was updated successfully, but these errors were encountered: