d'oh!
On 12 mar, 07:58, John Machin <[EMAIL PROTECTED]> wrote:
> On Mar 12, 10:29 pm, Bernard <[EMAIL PROTECTED]> wrote:
>
>
>
> > Hey Larry,
>
> > that one is fairly easy:
>
> > >>> from array import array
> > >>> array('i', [1, 2, 3, 4, 5, 1, 2])
> > >>> def count(x, arr):
>
> > cpt = 0
Thanks to all those who replied to this post. I'm gonna try your
suggestions. They are a great help.
--
http://mail.python.org/mailman/listinfo/python-list
On Mar 12, 10:29 pm, Bernard <[EMAIL PROTECTED]> wrote:
> Hey Larry,
>
> that one is fairly easy:
>
> >>> from array import array
> >>> array('i', [1, 2, 3, 4, 5, 1, 2])
> >>> def count(x, arr):
>
> cpt = 0 # declare a counter variable
> for el in arr: # for each element in the arra
Hey Larry,
that one is fairly easy:
>>> from array import array
>>> array('i', [1, 2, 3, 4, 5, 1, 2])
>>> def count(x, arr):
cpt = 0 # declare a counter variable
for el in arr: # for each element in the array
if el == x: # when it is equal to the 'x' value
On Mar 12, 10:26 am, Larry <[EMAIL PROTECTED]> wrote:
> I'm new to Python. I have a file (an image file actually) that I need
> to read pixel by pixel. It's an 8-bit integer type. I need to get the
> statistics like mean, standard deviation, etc., which I know a little
> bit already from reading nu
Dear all,
I'm new to Python. I have a file (an image file actually) that I need
to read pixel by pixel. It's an 8-bit integer type. I need to get the
statistics like mean, standard deviation, etc., which I know a little
bit already from reading numpy module. What I want to know is how to
get the n