<- Black sheep!!!
['a','b','c','m'] => 1
['a','b','c','n'] => 1
['a','b','c','o'] => 1
['a','b','c','p'] => 1
I can check a bit of
On Thursday, June 2, 2016 at 10:07:21 AM UTC+12, MRAB wrote:
> What is "this_list"? The main 'for' loop has "entry".
Sorry. :)
for entry in \
(
['a','b','c','l'],
['a','b','c'],
) \
:
flag = int(not any(m == "l" for m in entry))
...
On 2016-06-01 22:44, Lawrence D’Oliveiro wrote:
On Wednesday, June 1, 2016 at 2:22:42 AM UTC+12, Fillmore wrote:
['a','b','c','l'] => 0 # If "l" is in my data I have a zero
['a','b','c'] => 1 # or a more generic match will do the job
for entry in \
(
['a','b','c',
On Wednesday, June 1, 2016 at 2:22:42 AM UTC+12, Fillmore wrote:
> ['a','b','c','l'] => 0 # If "l" is in my data I have a zero
> ['a','b','c'] => 1 # or a more generic match will do the job
for entry in \
(
['a','b','c','l'],
['a','b','c'],
) \
On Wed, 1 Jun 2016 12:22 am, Fillmore wrote:
>
> My problem. I have lists of substrings associated to values:
>
> ['a','b','c','g'] => 1
> ['a','b','c','h'] => 1
> ['a','b','c','i'] => 1
> ['a','b','c','j'] => 1
> ['a','b','c','k'] => 1
> ['a','b','c','l'] => 0 # <- Black sheep!!!
> ['a','b','c
> ['a','b','c','n'] => 1
> ['a','b','c','o'] => 1
> ['a','b','c','p'] => 1
>
> I can check a bit of data against elements in this list and determine whether
#x27;] => 0 # <- Black sheep!!!
>> ['a','b','c','m'] => 1
>> ['a','b','c','n'] => 1
>> ['a','b','c','o'] => 1
>> ['a','
x27;b','c','m'] => 1
> ['a','b','c','n'] => 1
> ['a','b','c','o'] => 1
> ['a','b','c','p'] => 1
>
> I can check a bit of data a
x27;n'] => 1
['a','b','c','o'] => 1
['a','b','c','p'] => 1
I can check a bit of data against elements in this list
and determine whether the value to be associated to the data is 1 or 0.
I would like to m
[EMAIL PROTECTED] wrote:
> Intel has introduced something called CESR, written in Python, to aid
> C, C++, and Fortran programmers in reducing the sizes of programs
> included in bug reports. Here is a brief description from
> http://cache-www.intel.com/cd/00/00/21/93/219320_relnotes_10.pdf :
> ...
Intel has introduced something called CESR, written in Python, to aid
C, C++, and Fortran programmers in reducing the sizes of programs
included in bug reports. Here is a brief description from
http://cache-www.intel.com/cd/00/00/21/93/219320_relnotes_10.pdf :
"Compiler Error Source Reducer (CESR)
Many thanks
nikie wrote:
> Philippe Martin wrote:
>> PS: where can I find those extra parameters in the doc (ex: quality) ...
>> I must be blind.
> In the http://www.pythonware.com/library/pil/handbook/formats.htm page.
> Look in the "JPEG" section. Different file formats support different
> opt
Philippe Martin wrote:
> PS: where can I find those extra parameters in the doc (ex: quality) ... I
> must be blind.
In the http://www.pythonware.com/library/pil/handbook/formats.htm page.
Look in the "JPEG" section. Different file formats support different
options.
--
http://mail.python.org/mail
PS: where can I find those extra parameters in the doc (ex: quality) ... I
must be blind.
Philippe
nikie wrote:
> Philippe Martin wrote:
>> Hi,
>>
>> Thanks to the NG, I got the script hereunder working.
>>
>> 1) I am not certain that the call to convert does much (checking the doc)
>
> I thi
nikie wrote:
> Philippe Martin wrote:
>> Hi,
>>
>> Thanks to the NG, I got the script hereunder working.
>>
>> 1) I am not certain that the call to convert does much (checking the doc)
>
> I think you only need it if your source image comes in a format that
> can't be stored into a jpeg file (e.g
Philippe Martin wrote:
> Hi,
>
> Thanks to the NG, I got the script hereunder working.
>
> 1) I am not certain that the call to convert does much (checking the doc)
I think you only need it if your source image comes in a format that
can't be stored into a jpeg file (e.g. 8-bit paletted). You'll n
Kamilche wrote:
> Be sure and use mode = P instead of RGB, like you have in your other
> code. P is for palettized images. Don't palettize if you're storing as
> JPG, only if you're storing as PNG or some other format that can handle
> 256 color images.
My problem is this:
1) If I use a save to
Be sure and use mode = P instead of RGB, like you have in your other
code. P is for palettized images. Don't palettize if you're storing as
JPG, only if you're storing as PNG or some other format that can handle
256 color images.
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
Thanks to the NG, I got the script hereunder working.
1) I am not certain that the call to convert does much (checking the doc)
2) Can this be improved as far as the final image size in (X,Y) ?
For instance, passing a large .jpg with a target byte size of 7000, I get
final (X,Y) results aro
Kamilche,
I am posting the code in another thread but am not certain that convert does
anything to the picture color depth ... still searching in the doc.
Philippe
Kamilche wrote:
>
> To reduce the color depth of an image in PIL:
> im = im.convert(mode="P", palette=Image.ADAPTIV
Thanks,
I'll give it a shot.
Philippe
Kamilche wrote:
>
> To reduce the color depth of an image in PIL:
> im = im.convert(mode="P", palette=Image.ADAPTIVE)
--
http://mail.python.org/mailman/listinfo/python-list
To reduce the color depth of an image in PIL:
im = im.convert(mode="P", palette=Image.ADAPTIVE)
--
http://mail.python.org/mailman/listinfo/python-list
Larry,
I actually did not find what I needed in PIL (missed it ?) but found this
package quite usefull: http://www.imagemagick.org/script/index.php
Philippe
Larry Bates wrote:
> Philippe Martin wrote:
>> Hi,
>>
>> I need to write a script to reduce the resolution/color depth of an image
>>
Philippe Martin wrote:
> Hi,
>
> I need to write a script to reduce the resolution/color depth of an image
> (ex: .jpg) based on a target size.
>
> The point is for the target picture to still be "understandable" - yet I
> target getting down to 5K.
>
> Are there libraries out there that could h
Hi,
I need to write a script to reduce the resolution/color depth of an image
(ex: .jpg) based on a target size.
The point is for the target picture to still be "understandable" - yet I
target getting down to 5K.
Are there libraries out there that could help me start ?
Thanks
Philippe
--
ht
ago wrote:
[Something I mostly agree with]
> According to Anton the number of possible solutions can be reduced
> using 1) number swapping, 2) mirroring, 3) blocks/rows/columns
> swapping. All those operations create equivalent matrices. For a 9X9
> grid, this should give a redu
and you get the solution.
According to Anton the number of possible solutions can be reduced
using 1) number swapping, 2) mirroring, 3) blocks/rows/columns
swapping. All those operations create equivalent matrices. For a 9X9
grid, this should give a reduction factor = (9!)*(48)*(6^12) minus the
number
ago wrote:
> Do you think it is possible to reduce the set of all possible solutions
> to a small enough set? I personally doubt it, but IF that was the case
> an efficient solver could be easily created.
No I don't think so, but it's a great idea :-) . Iff we would have some
ultimate symmetry de
>Your reduction-first approach makes short work of
> them, though. On the other hand, my version probably didn't take as long
> to write!
Well, I started from the reduction-only algorithm so by the time I
implemented the brute force solver I already had the code. Anyway the
ful
Anton,
Do you think it is possible to reduce the set of all possible solutions
to a small enough set? I personally doubt it, but IF that was the case
an efficient solver could be easily created.
In reducing the set of all solutions for instance you could always swap
the numbers (3rd axis) so that
am I sort-of lost interest.
The first three sample boards included are all quite difficult, and take
some time to solve (and verify no other solutions exist!) with a
depth-first search. Your reduction-first approach makes short work of
them, though. On the other hand, my version probably didn
ago wrote:
> You can see my amended code in the link above.
Thanks, I will look into it sometime. At the moment I'm at a library
computer, which severely limits my Python options. Meanwhile I have
been thinking about the sudoku problem, maybe it will prompt you, me or
someone else to make some ki
he nice post.
The issue with my code was not due to the reduction algorithms used.
In fact we used exactly the same set of rules, my Cell.solve was
equivalent to your Clean1 method and my Cell.skim was equivalent to
your Clean3 method (except that my algorithm was only doing "for (o1,
o2) in ((o
There is more in this thread:
http://groups.google.com/group/comp.lang.python/browse_frm/thread/479c1dc768f740a3/9252dab14e8ecabb?q=sudoku&rnum=2#9252dab14e8ecabb
Enjoy,
Bas
--
http://mail.python.org/mailman/listinfo/python-list
ago wrote:
> Inspired by some recent readings on LinuxJournal and an ASPN recipe, I
> decided to revamp my old python hack... The new code is a combination
> of (2) reduction methods and brute force and it is quite faster than
> the
> ASPN program. If anyone is interested I attac
ago wrote:
> Inspired by some recent readings on LinuxJournal and an ASPN recipe, I
> decided to revamp my old python hack... The new code is a combination
> of (2) reduction methods and brute force and it is quite faster than
> the
> ASPN program. If anyone is interested I attac
bmitted by me:http://digg.com/programming/SudokuBan_Wins_%C2%A3300
-- end --On 13 Jan 2006 16:00:45 -0800, ago <[EMAIL PROTECTED]> wrote:
Inspired by some recent readings on LinuxJournal and an ASPN recipe, Idecided to revamp my old python hack... The new code is a combinationof (2) reduction m
Inspired by some recent readings on LinuxJournal and an ASPN recipe, I
decided to revamp my old python hack... The new code is a combination
of (2) reduction methods and brute force and it is quite faster than
the
ASPN program. If anyone is interested I attached the code in
http
I think you mean,
newlist = [y for y in industrylist if y.cap < x]
otherwise you've got a list of caps, not a list of objects with the
cap attribute.
On Thu, 10 Mar 2005 12:10:31 -0800, James Stroud <[EMAIL PROTECTED]> wrote:
> newlist = [y.cap for y in industrylist if y.cap < x]
>
> On Thursd
newlist = [y.cap for y in industrylist if y.cap < x]
On Thursday 10 March 2005 12:00 pm, Leeds, Mark wrote:
> I have a structure in python that I think is a list
>
> with elements .Cap and .Ticker
>
> where Cap is a float and Ticker is string.
>
>
>
> So, I reference things like
>
> industrylist[i
I have a structure in python that I think is a list
with elements .Cap
and .Ticker
where Cap
is a float and Ticker
is string.
So, I reference things like
industrylist[i].cap and industrylist[i].ticker
and this works fine.
What I want to do is reduce the list
so that it only
41 matches
Mail list logo