Re: [Numpy-discussion] patching docs
william ratcliff
Hi! I'd like to suggest a patch for: numpy http://docs.scipy.org/numpy/docs/numpy/.corehttp://docs.scipy.org/numpy/docs/numpy.core/ .fromnumeric http://docs.scipy.org/numpy/docs/numpy.core.fromnumeric/.put The docstring contains:
for i, val in zip(ind,v): x.flat[i]=val
It should be:
for i, val in zip(ind,v): a.flat[i]=val
Thanks! It appears you are basing your patch on a numpy release rather than the wiki you have actually linked to, as this problem was fixed on 2009-03-16 by Ralf Gommers.
This would be more consistent with the rest of the docstring. For the future, is there an easy way for us to patch docstrings?
Sure! Follow the instructions on docs.scipy.org/numpy/ and make yourself a doc wiki account. Post the account name to the scipy-dev mailing list and ask to be made an editor. Then please edit! But, please be careful that you develop any changes based on the current docstrings and not something from a release. Because the releases are snapshots of a fast-moving project, they are often out of date (In fact, I tell my students to use the doc wiki as their best source of docs, and to ignore help()). Thanks again, --jh--
Actually, if I look here:
http://docs.scipy.org/numpy/docs/numpy.core.fromnumeric.put/
The text that appears in by browser is:
*put(a, ind, v, mode='raise')*
Changes specific elements of one array by replacing from another array.
The indexing works on the flattened target array,
puthttp://docs.scipy.org/numpy/docs/numpy.core.fromnumeric.put/#putis
roughly equivalent to:
for i, val in zip(ind, v):
x.flat[i] = val
Am I missing something obvious????
cheers,
William
On Fri, Apr 24, 2009 at 9:43 AM, Joe Harrington
william ratcliff
writes: Hi! I'd like to suggest a patch for: numpy http://docs.scipy.org/numpy/docs/numpy/.core< http://docs.scipy.org/numpy/docs/numpy.core/> .fromnumeric <http://docs.scipy.org/numpy/docs/numpy.core.fromnumeric/ .put The docstring contains:
for i, val in zip(ind,v): x.flat[i]=val
It should be:
for i, val in zip(ind,v): a.flat[i]=val
Thanks!
It appears you are basing your patch on a numpy release rather than the wiki you have actually linked to, as this problem was fixed on 2009-03-16 by Ralf Gommers.
This would be more consistent with the rest of the docstring. For the future, is there an easy way for us to patch docstrings?
Sure! Follow the instructions on docs.scipy.org/numpy/ and make yourself a doc wiki account. Post the account name to the scipy-dev mailing list and ask to be made an editor. Then please edit! But, please be careful that you develop any changes based on the current docstrings and not something from a release. Because the releases are snapshots of a fast-moving project, they are often out of date (In fact, I tell my students to use the doc wiki as their best source of docs, and to ignore help()).
Thanks again,
--jh-- _______________________________________________ Numpy-discussion mailing list Numpy-discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
2009/4/24 william ratcliff
Actually, if I look here: http://docs.scipy.org/numpy/docs/numpy.core.fromnumeric.put/
The text that appears in by browser is:
put(a, ind, v, mode='raise')
Changes specific elements of one array by replacing from another array.
This is pretty cryptic. I've changed it to """ put(a, ind, v, mode='raise') Replaces specified elements of an array with given values. """ Your error report was correct. I've changed the x to an a. Cheers Stéfan
Thanks! I was up pretty late last night and wanted to make sure I hadn't
missed something while sleep deprived!
Cheers,
William
2009/4/24 Stéfan van der Walt
2009/4/24 william ratcliff
: Actually, if I look here: http://docs.scipy.org/numpy/docs/numpy.core.fromnumeric.put/
The text that appears in by browser is:
put(a, ind, v, mode='raise')
Changes specific elements of one array by replacing from another array.
This is pretty cryptic. I've changed it to
""" put(a, ind, v, mode='raise')
Replaces specified elements of an array with given values. """
Your error report was correct. I've changed the x to an a.
Cheers Stéfan _______________________________________________ Numpy-discussion mailing list Numpy-discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
participants (3)
-
Joe Harrington
-
Stéfan van der Walt
-
william ratcliff