Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #81022 > unrolled thread
| Started by | MRAB <python@mrabarnett.plus.com> |
|---|---|
| First post | 2014-11-19 02:52 +0000 |
| Last post | 2014-11-19 02:52 +0000 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: scipy shape MRAB <python@mrabarnett.plus.com> - 2014-11-19 02:52 +0000
| From | MRAB <python@mrabarnett.plus.com> |
|---|---|
| Date | 2014-11-19 02:52 +0000 |
| Subject | Re: scipy shape |
| Message-ID | <mailman.15987.1416365571.18130.python-list@python.org> |
On 2014-11-19 02:30, Abdul Abdul wrote: > I came across an example that starts as follows: > > from scipy.ndimage import filters > img = zeros(im.shape) > > What does the second line mean here? Is it setting the image pixels to > zero? What is "shape" here? > It looks like it might be using numpy. If 'im' is a numpy array representing an image, then its .shape attribute is giving its 'shape' (a tuple of the sizes of its dimensions). numpy.zeros(...) will when return a numpy array of the same shape. So, it's not setting the image pixels to 0, but creating a new image of the same shape in which the pixels are 0.
Back to top | Article view | comp.lang.python
csiph-web