[Numpy-discussion] Little module to get numpy examples

Bill Baxter wbaxter@gmail....
Sun Mar 18 20:42:26 CDT 2007

I wrote a little python module to go fetch the Numpy examples from the
scipy wiki page, parse them, and print out entries.

Is there a good place on the wiki for this?
It didn't really seem right in the cookbook, and it doesn't quite fit
with documentation.

Here's an example of use:

In [1]: import numpy
In [2]: from NumpyExamples import examples
In [3]: examples(numpy.hstack)
--- hstack ---
>>> from numpy import *
>>> a =array([[1],[2]])
  # 2x1 array
>>> b = array([[3,4],[5,6]])
  # 2x2 array
>>> hstack((a,b,a))
  # only the 2nd dimension of the arrays is allowed to be different
array([[1, 3, 4, 1],
       [2, 5, 6, 2]])
See also: column_stack, concatenate, dstack, vstack, hsplit

-------------- next part --------------
A non-text attachment was scrubbed...
Name: NumpyExamples.py
Type: text/x-python
Size: 8882 bytes
Desc: not available
Url : http://projects.scipy.org/pipermail/numpy-discussion/attachments/20070319/b81e2ea7/attachment.py 

More information about the Numpy-discussion mailing list