
Hi, i am new to numpy. This is first time i am using numpy. https://github.com/mspieg/dynamical-systems/blob/master/Bifurcations.ipynb This code i found to create bifurcation graph. There is section of code which i am not able to understand vr[stable], vx[stable] vr and vx is array of 150 elements. unstable and stable array also has 150 elements But vr[stable], vx[stable] becomes 75 elements in the array. Which i am not able to umderstand how 150 elements in array drops to 75

Hi, I believe this question fits Stack Overflow better. Here're SO guidelines on how to create a minimal reproducible example: https://stackoverflow.com/help/minimal-reproducible-example If you're new to NumPy I'd recommend this visual guide: https://betterprogramming.pub/numpy-illustrated-the-visual-guide-to-numpy-3b... Best regards, Lev On Thu, Jan 27, 2022 at 8:19 PM <bigfixforum@gmail.com> wrote:
Hi, i am new to numpy. This is first time i am using numpy.
https://github.com/mspieg/dynamical-systems/blob/master/Bifurcations.ipynb
This code i found to create bifurcation graph. There is section of code which i am not able to understand
vr[stable], vx[stable]
vr and vx is array of 150 elements. unstable and stable array also has 150 elements
But vr[stable], vx[stable] becomes 75 elements in the array. Which i am not able to umderstand how 150 elements in array drops to 75 _______________________________________________ NumPy-Discussion mailing list -- numpy-discussion@python.org To unsubscribe send an email to numpy-discussion-leave@python.org https://mail.python.org/mailman3/lists/numpy-discussion.python.org/ Member address: lev.maximov@gmail.com

Agreed, however, the[ NumPy learn section of the official documentation](https://numpy.org/learn/) is probably a better place to point to (though your article is justifiably also linked from there). --- Rohit On 27 Jan 2022, at 16:15, Lev Maximov wrote:
Hi,
I believe this question fits Stack Overflow better.
Here're SO guidelines on how to create a minimal reproducible example: https://stackoverflow.com/help/minimal-reproducible-example
If you're new to NumPy I'd recommend this visual guide: https://betterprogramming.pub/numpy-illustrated-the-visual-guide-to-numpy-3b...
Best regards, Lev
On Thu, Jan 27, 2022 at 8:19 PM <bigfixforum@gmail.com> wrote:
Hi, i am new to numpy. This is first time i am using numpy.
https://github.com/mspieg/dynamical-systems/blob/master/Bifurcations.ipynb
This code i found to create bifurcation graph. There is section of code which i am not able to understand
vr[stable], vx[stable]
vr and vx is array of 150 elements. unstable and stable array also has 150 elements
But vr[stable], vx[stable] becomes 75 elements in the array. Which i am not able to umderstand how 150 elements in array drops to 75 _______________________________________________ NumPy-Discussion mailing list -- numpy-discussion@python.org To unsubscribe send an email to numpy-discussion-leave@python.org https://mail.python.org/mailman3/lists/numpy-discussion.python.org/ Member address: lev.maximov@gmail.com
_______________________________________________ NumPy-Discussion mailing list -- numpy-discussion@python.org To unsubscribe send an email to numpy-discussion-leave@python.org https://mail.python.org/mailman3/lists/numpy-discussion.python.org/ Member address: rgoswami@quansight.com

Yes, this page has a ton of interesting stuff, too! I gave just one link because it might take time to choose between 10 excellent tutorials. It's just my personal preference :) Btw, is it possible to automate the detection of dead links on that page? Lev On Thu, Jan 27, 2022 at 11:25 PM Rohit Goswami <rgoswami@quansight.com> wrote:
Agreed, however, the NumPy learn section of the official documentation <https://numpy.org/learn/> is probably a better place to point to (though your article is justifiably also linked from there). ------------------------------
Rohit
On 27 Jan 2022, at 16:15, Lev Maximov wrote:
Hi,
I believe this question fits Stack Overflow better.
Here're SO guidelines on how to create a minimal reproducible example: https://stackoverflow.com/help/minimal-reproducible-example
If you're new to NumPy I'd recommend this visual guide:
https://betterprogramming.pub/numpy-illustrated-the-visual-guide-to-numpy-3b...
Best regards, Lev
On Thu, Jan 27, 2022 at 8:19 PM <bigfixforum@gmail.com> wrote:
Hi, i am new to numpy. This is first time i am using numpy.
https://github.com/mspieg/dynamical-systems/blob/master/Bifurcations.ipynb
This code i found to create bifurcation graph. There is section of code which i am not able to understand
vr[stable], vx[stable]
vr and vx is array of 150 elements. unstable and stable array also has 150 elements
But vr[stable], vx[stable] becomes 75 elements in the array. Which i am not able to umderstand how 150 elements in array drops to 75 _______________________________________________ NumPy-Discussion mailing list -- numpy-discussion@python.org To unsubscribe send an email to numpy-discussion-leave@python.org https://mail.python.org/mailman3/lists/numpy-discussion.python.org/ Member address: lev.maximov@gmail.com
_______________________________________________ NumPy-Discussion mailing list -- numpy-discussion@python.org To unsubscribe send an email to numpy-discussion-leave@python.org https://mail.python.org/mailman3/lists/numpy-discussion.python.org/
Member address: rgoswami@quansight.com
_______________________________________________ NumPy-Discussion mailing list -- numpy-discussion@python.org To unsubscribe send an email to numpy-discussion-leave@python.org https://mail.python.org/mailman3/lists/numpy-discussion.python.org/ Member address: lev.maximov@gmail.com

On Thu, Jan 27, 2022 at 8:18 AM <bigfixforum@gmail.com> wrote:
Hi, i am new to numpy. This is first time i am using numpy.
https://github.com/mspieg/dynamical-systems/blob/master/Bifurcations.ipynb
This code i found to create bifurcation graph. There is section of code which i am not able to understand
vr[stable], vx[stable]
vr and vx is array of 150 elements. unstable and stable array also has 150 elements
But vr[stable], vx[stable] becomes 75 elements in the array. Which i am not able to umderstand how 150 elements in array drops to 75
`stable` is a boolean array which is True where `f_x(vr, vx) < 0` and False otherwise. When a boolean array is used as an index, the resulting array only has the elements where the boolean value in the index array is True and dropping all of the elements where it is False. That is why the number of elements changes. https://numpy.org/doc/stable/user/basics.indexing.html#boolean-array-indexin... -- Robert Kern

Thanks Robert. I though about the same that boolean must be dropping the elements but i wasn't sure about it. Thanks for the confirmation. Appreciate your help.
participants (4)
-
bigfixforum@gmail.com
-
Lev Maximov
-
Robert Kern
-
Rohit Goswami