Peter Hansen wrote:
> [EMAIL PROTECTED] wrote:
>
>> I get a syntax error in :
>>
>> py> [(min((abs(p - v), v) for v in valleys + [0] if v < p)[1],
>> ... p,
>> ... min((abs(p - v), v) for v in valleys if v > p)[1])
>> ... for p in peaks]
>
>
> I think we already covered the part where you
[EMAIL PROTECTED] wrote:
> I get a syntax error in :
>
> py> [(min((abs(p - v), v) for v in valleys + [0] if v < p)[1],
> ... p,
> ... min((abs(p - v), v) for v in valleys if v > p)[1])
> ... for p in peaks]
I think we already covered the part where you were using an older
version of Pyth
oh yes its the same case. even [0,4,9,2,0] as a set [2,6] and may be
not [2,7]. Its not that you are wrong its jus that I was not clear.
Sorry about that.
--
http://mail.python.org/mailman/listinfo/python-list
I get a syntax error in :
py> [(min((abs(p - v), v) for v in valleys + [0] if v < p)[1],
... p,
... min((abs(p - v), v) for v in valleys if v > p)[1])
... for p in peaks]
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
> Hi Kent,
> Thanks for that. But We are considering [..., 0, 101, 0, 0, 0, 0, 0] ->
> [13,18] .In fact if you look at the list, the histogram ends at 15 that
> is [0,101,0] --> [13,15]. Dont you think so.
>
Well you consider ..., 0, 4, 9, 2, 0, 0, ... as an int
Hi Kent,
Thanks for that. But We are considering [..., 0, 101, 0, 0, 0, 0, 0] ->
[13,18] .In fact if you look at the list, the histogram ends at 15 that
is [0,101,0] --> [13,15]. Dont you think so.
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
> Hi Steve!
> I am not sure if I was clear with my previous post .Ok let me rephrase
> it .
>
> Assume the values list is the
> content of a histogram. Then we see that
> values = [ 0, 72, 2, 4, 9, 2, 0, 0, 42, 26, 0, 282,
> 23, 0, 101, 0, 0, 0, 0
[EMAIL PROTECTED] wrote:
> If this is the list.
>
> values = [ 0, 72, 0, 4, 9, 2, 0, 0, 42, 26, 0, 282,
> 23, 0, 101, 0, 0, 0, 0, 0]
>
> as we can see there are peaks in the list.that is 0,72,0 is a
> group(triangle) with peak 72.then 0, 4, 9, 2, 0, 0 with pe
Hi Steve!
I am not sure if I was clear with my previous post .Ok let me rephrase
it .
Assume the values list is the
content of a histogram. Then we see that
values = [ 0, 72, 2, 4, 9, 2, 0, 0, 42, 26, 0, 282,
23, 0, 101, 0, 0, 0, 0, 0]
1 is repeated 72 times, 3 -> 4 t
what if we do something like this. Assume the values list is the
content of a histogram. Then we see that
values = [ 0, 72, 0, 4, 9, 2, 0, 0, 42, 26, 0, 282,
23, 0, 101, 0, 0, 0, 0, 0]
1 is repeated 72 times, 3 -> 4 times and so on. That is the index
would be the value
[EMAIL PROTECTED] wrote:
> Thanks for that. My version of python does'nt find "groupby". I am
> using python 2.3.2. Is there a way I could do it with out using groupby
itertools.groupby is in Python 2.4. The docs[1] give a Python
equivalent, so if for some reason you can't upgrade to the current
Thanks for that. My version of python does'nt find "groupby". I am
using python 2.3.2. Is there a way I could do it with out using groupby
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
> If this is the list.
>
> values = [ 0, 72, 0, 4, 9, 2, 0, 0, 42, 26, 0, 282,
> 23, 0, 101, 0, 0, 0, 0, 0]
>
> as we can see there are peaks in the list.that is 0,72,0 is a
> group(triangle) with peak 72.then 0, 4, 9, 2, 0, 0 with pe
If this is the list.
values = [ 0, 72, 0, 4, 9, 2, 0, 0, 42, 26, 0, 282,
23, 0, 101, 0, 0, 0, 0, 0]
as we can see there are peaks in the list.that is 0,72,0 is a
group(triangle) with peak 72.then 0, 4, 9, 2, 0, 0 with peak
9 and 0, 42, 26, 0 with 42 and s
14 matches
Mail list logo