On Oct 22, 6:32 am, Steven D'Aprano wrote:
>
> Sure. But the downside of sets is that, like lists, they are not lazy,
Thank you for pointing this out. I agree that it's not a viable
alternative for large domains. Storing the bounds and the resolution
should be enough.
/Sigmund
--
http://mail.py
On Oct 21, 2:55 am, Yingjie Lan wrote:
>
> In simulation, one can use range objects to denote a discrete domain,
> and domain comparison could be very useful. Not just equality, but also
> things like if one domain is contained in another.
Can't sets [help(set)] be used for this?
--
http://mail
On Oct 13, 10:04 am, Laurent Claessens wrote:
> Thanks all for your ansers. I'll import division from __future__
> Most of what I'm using in Python is with Sage[1]. Thus I'm not about to
> step to 3.x :(
You should get in touch with the Sage developers. In the Sage FAQ they
say that "until SciPy
On Aug 17, 9:22 pm, Yingjie Lin wrote:
> I found zip() but it only gives [('a', '1'), ('b', '2')], not exactly what I
> am looking for.
Yet, if you feed the zip into a list comprehension you get what you
want:
li3 = [''.join(l) for l in zip(li1,li2)]
Sigmund
--
http://mail.python.org/mailma
Bloody hell! This is the most persistent troll I've seen to date. He
expected to get a raging army of pythoners after him, but people are
just laughing at him. This is a mailing list, not a novel, so
colloquialisms are welcome. The language on a mailing list should be
informal and not necessarily g
On Aug 12, 8:10 am, przemol...@poczta.fm wrote:
> Good question but I try to explain what motivates me to do it.
> First reason (I think the most important :-) ) is that I want to learn
> something new - I am new to python (I am unix/storage sysadmin but with
> programming
> background so python w
When I saw the headline I thought "oh no, not string concatenation
again... we have had scores of these thread before...", but this is a
rather interesting problem. The OP says he's not a database
developer, but why is he then fiddling with internal database
operations? Wouldn't it be better to go
On Jul 24, 9:59 am, Benjamin Gregg
wrote:
> Hi
> python was my first language but I need to learn C++ and java for a
> project (No there isn't an alternative)
> and I want to know is there any good tutorials or tips for learning
> C++/java after using python?
I think it's always best to approach
On Jul 24, 8:43 am, Laszlo Nagy wrote:
> Can it be a problem on my side? I have tried from several different
> computers. I cannot even ping it.
Whenever a page can't be accessed, although your connection is good,
http://www.downforeveryoneorjustme.com/ is a good site to check.
Sigmund
--
http
On Jul 25, 10:48 am, Steven D'Aprano wrote:
>
> One other important proviso: if your map function is a wrapper around a
> Python expression:
>
> map(lambda x: x+1, data)
> [x+1 for x in data]
>
> then the list comp will be much faster, due to the overhead of the function
> call. List comps and gen
On Jul 21, 10:31 am, "Frank Millman" wrote:
> Is there a short cut, or must I do this every time (I have lots of them!) ?
> I know I can write a function to do this, but is there anything built-in?
I'd say that we have established that there is no shortcut, no built-
in for this. You write you ow
I'm using 2.7.1, because that's what my Ubuntu 11.04 bundles (python --
version reports 2.7.1+ though, no idea what the + means). On the other
hand, Ubuntu provides 3.2 packages via apt-get, so I'm in the process
of migrating to 3k. I really like the focus on laziness in 3k (don't
know if 'focus' i
There is a nice matrix representation of consecutive Fibonacci
numbers: [[1, 1], [1, 0]] ** n = [[F_n+1, F_n], [F_n, F_n-1]]. Using
the third party mpmath module, which uses arbitrary precision floating
point arithmetic, we can calculate the n'th Fibonacci number for an
arbitrary n as follows:
imp
I'm sorry I top posted. I'll remember not to top post next time.
Sigmund
--
http://mail.python.org/mailman/listinfo/python-list
I think the OP wants to find the intersection of two lists.
list(set(list1) & set(list2)) is indeed one way to achieve this. [i
for i in list1 if i in list2] is another one.
Sigmund
On May 15, 4:11 am, Chris Torek wrote:
> In article <871v00j2bh@benfinney.id.au>
> Ben Finney wrote:
>
> >As
15 matches
Mail list logo