rbt wrote:
> On Wed, 2005-07-13 at 11:09 -0400, rbt wrote:
>
>>On Wed, 2005-07-13 at 10:21 -0400, rbt wrote:
>>
>>>Say I have a list that has 3 letters in it:
>>>
>>>['a', 'b', 'c']
>>>
>>>I want to print all the possible 4 digit combinations of those 3
>>>letters:
>>>
>>>4^3 = 64
>>>
>>>
>>>a
Jack Diederich wrote:
> On Wed, Jul 13, 2005 at 05:07:33PM +0100, Duncan Smith wrote:
>
>>rbt wrote:
>>
>>>On Wed, 2005-07-13 at 11:09 -0400, rbt wrote:
>>>
>>>
>>>>On Wed, 2005-07-13 at 10:21 -0400, rbt wrote:
>>>>
>>&
"engsol" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> There is a number puzzle which appears in the daily paper.
> Because I'm between Python projects, I thought it might be
> fun to write a program to solve it20 minute job, max.
>
> On closer inspection, it became apparent th
On 11/12/13 23:54, Steven D'Aprano wrote:
I have some code which produces a list from an iterable using at least
one temporary list, using a Decorate-Sort-Undecorate idiom. The algorithm
looks something like this (simplified):
table = sorted([(x, i) for i,x in enumerate(iterable)])
table = [i fo
On 18/01/14 01:51, John Ladasky wrote:
Hi folks,
I am awaiting my approval to join the numpy-discussion mailing list, at
scipy.org. I realize that would be the best place to ask my question.
However, numpy is so widely used, I figure that someone here would be able to
help.
I like to use n
Hello,
I'm trying to find a computationally efficient way of identifying
unique subarrays, counting them and returning an array containing only
the unique subarrays and a corresponding 1D array of counts. The
following code works, but is a bit slow.
###
from collections import C
On 04/12/15 22:36, Albert-Jan Roskam wrote:
> Hi
>
> (Sorry for topposting)
>
> numpy.ravel is faster than numpy.flatten (no copy)
> numpy.empty is faster than numpy.zeros
> numpy.fromiter might be useful to avoid the loop (just a hunch)
>
> Albert-Jan
>
Thanks, I'd forgotten the difference be
On 04/12/15 23:06, Peter Otten wrote:
> duncan smith wrote:
>
>> Hello,
>> I'm trying to find a computationally efficient way of identifying
>> unique subarrays, counting them and returning an array containing only
>> the unique subarrays and a co
On 21/12/15 03:01, Steven D'Aprano wrote:
> I have a large number of strings (originally file names) which tend to fall
> into two groups. Some are human-meaningful, but not necessarily dictionary
> words e.g.:
>
>
> baby lions at play
> saturday_morning12
> Fukushima
> ImpossibleFork
>
>
> (no
On 21/12/15 16:49, Ian Kelly wrote:
> On Mon, Dec 21, 2015 at 9:40 AM, duncan smith wrote:
>> Finite state machine / transition matrix. Learn from some English text
>> source. Then process your strings by lower casing, replacing underscores
>> with spaces, removing trailing n
Hello,
I'm just getting to grips with RDF and rdflib, and I've hit
something I can't figure out.
I have a graph with information on two people. (I haven't shown the
imports below because they're scattered around my interactive session
and I might reconstruct them incorrectly. Anyone familiar
On 02/03/16 08:16, dieter wrote:
> duncan smith writes:
>
>> I'm just getting to grips with RDF and rdflib, and I've hit
>> something I can't figure out.
>>
>> I have a graph with information on two people. (I haven't shown the
&g
Hello,
I have a Bloom filter class and want to (partially) serialize
instances using hex() or oct(). Instances are mutable, so I can't
inherit from long. I thought I'd found the answer when I came across
__index__,
https://docs.python.org/2/reference/datamodel.html#object.__index__. But
it do
On 01/11/14 16:56, duncan smith wrote:
[snip]
Sorry, forgot to add that I'm using Python 2.7.6 on Ubuntu 14.04. Cheers.
Duncan
--
https://mail.python.org/mailman/listinfo/python-list
On 01/11/14 18:29, Ethan Furman wrote:
> On 11/01/2014 10:11 AM, Ned Batchelder wrote:
>> On 11/1/14 12:56 PM, duncan smith wrote:
>>>
>>>I have a Bloom filter class and want to (partially) serialize
>>> instances using hex() or oct(). Instances are
On 21/11/14 08:35, Steve Hayes wrote:
> I've finally found a use for Python.
>
> When, in the course of my genealogy research, I look at census or burial
> records, I often want to work out a person's date of birth from their age.
> It's a simple matter of mental arithmetic, but I sometimes get i
On 21/02/15 19:46, TommyVee wrote:
> Start off with sets of elements as follows:
>
> 1. A,B,E,F
> 2. G,H,L,P,Q
> 3. C,D,E,F
> 4. E,X,Z
> 5. L,M,R
> 6. O,M,Y
>
> Note that sets 1, 3 and 4 all have the element 'E' in common, therefore
> they are "related" and form the following superset:
>
> A,B,C
On 16/02/14 05:08, Ben Finney wrote:
Tim Chase writes:
I'm not coming up with the right keywords to find what I'm hunting.
I'd like to randomly sample a modestly compact list with weighted
distributions, so I might have
data = (
("apple", 20),
("orange", 50),
("grape", 30),
On 16/02/14 16:35, Charles Allen wrote:
How efficient does this thing need to be?
You can always just turn it into a two-dimensional sampling problem by
thinking of the data as a function f(x=item), generating a random x=xr
in [0,x], then generating a random y in [0,max(f(x))]. The xr is
accept
On 16/05/14 13:57, Enlong Liu wrote:
Sorry for this inconvenience. Since my file is a little large, I think it will
be more difficult for fellows to check. I will now paste the attachment below.
The file for T(E) consists of two columns, the first is E and the second is
T(E). What I want is to
On 16/05/14 16:01, Johannes Schneider wrote:
If you do not have a closed form for T(E) you cannot calculate the exact
value of I(V).
Anyway. Assuming T is integrable you can approximate I(V).
1. Way to do:
interpolate T(E) by a polynomial P and integrate P. For this you need
the equation (coeff
On 11/08/13 15:02, Roy Smith wrote:
In article ,
Skip Montanaro wrote:
See the Rationale of PEP 450 for more reasons why “install NumPy� is not
a feasible solution for many use cases, and why having ‘statistics’ as a
pure-Python, standard-library package is desirable.
I read that b
On 14/08/13 15:16, climb65 wrote:
Hello,
here is a small basic question :
Is it possible to have more than one constructor (__init__ function) in a
class? For instance, to create an object with 2 different ways? If my
memory is good, I think that with C++ it is possible.
Thanks for your answer
On 02/07/15 15:52, Steven D'Aprano wrote:
> Despite the title, this is not one of the usual "Why can't Python do
> maths?" "bug" reports.
>
> Can anyone reproduce this behaviour? If so, please reply with the version of
> Python and your operating system. Printing sys.version will probably do.
>
>
On 29/07/15 15:27, ryguy7272 wrote:
> On Wednesday, July 29, 2015 at 10:21:35 AM UTC-4, ryguy7272 wrote:
>> On Wednesday, July 29, 2015 at 9:59:10 AM UTC-4, ryguy7272 wrote:
>>> I am using Spyder Python 2.7. I'm running this sample code.
>>>
>>> import scipy as sp
>>> cashflows=[50,40,20,10,50]
>>
On 01/10/15 21:45, Paulo da Silva wrote:
> Hi all.
>
> What is the fastest way to do the following:
>
> I have an initial value V and a vector vec of (financial) indexes.
> I want to generate a new vector nvec as
>
> V, V*vec[0], V*vec[0]*vec[1], V*vec[0]*vec[1]*vec[2], ...
>
> A numpy vectoriz
On 09/10/14 18:43, mm0fmf wrote:
> On 09/10/2014 02:29, Steven D'Aprano wrote:
>> Apart from the horrible spelling of colour :-)
>
> I've always spelt colour as "color" when programming and as "colour"
> when writing language including documentation about software.
>
> colour in a programme doesn
On 11/10/14 12:45, mm0fmf wrote:
> On 11/10/2014 10:37, Christian Gollwitzer wrote:
>> Being a non-native English speaker/writer, I myself stick to the
>> recommendations of the Oxford dictionary.
>>
>> Christian
>
> But you do realise the Oxford dictionary is different to English usage
> and
On 11/10/14 20:55, William Ray Wing wrote:
> On Oct 11, 2014, at 3:20 PM, Dennis Lee Bieber wrote:
>
>> On Sat, 11 Oct 2014 16:26:43 +0100, duncan smith
>> declaimed the following:
>>
>>
>>> The media have their own quirks when it comes to English. The B
On 14/10/11 08:45, Libra wrote:
Hi,
I would like to build a simple graph editor, allowing me to add nodes
and edges via the mouse, along with the possibility to edit it (delete/
move nodes and edges, double click on object to pop-up a form where I
can insert object related info, and so forth) and
On 01/11/11 15:05, Gnarlodious wrote:
I want to assign a list of variables:
locus=[-2, 21, -10, 2, 12, -11, 0, 3]
updating a list of objects each value to its respective instance:
for order in range(len(Orders)):
Orders[order].locus=locus[order]
This works, even though it reads like do
On 19/02/13 22:19, Rex Macey wrote:
I'm new to Python and only a hobbyist programmer. A long time ago I used
Microsoft's Visual Basic which had a nice (graphical) facility for creating
GUIs which was part of the development environment. I'm wondering if there's a
utility for Python to build
On 28/03/13 15:25, Wolfgang Maier wrote:
Dear all, with
a=list(range(1,11))
why (in Python 2.7 and 3.3) is this explicit for loop working:
for i in a[:-1]:
a.pop() and a
giving:
[1, 2, 3, 4, 5, 6, 7, 8, 9]
[1, 2, 3, 4, 5, 6, 7, 8]
[1, 2, 3, 4, 5, 6, 7]
[1, 2, 3, 4, 5, 6]
[1, 2, 3, 4, 5]
[1
On 02/05/13 00:11, Dan Stromberg wrote:
What's the best Red Black Tree implementation for Python with an
opensource license?
I started out looking at
http://newcenturycomputers.net/projects/rbtree.html because it was
pretty high in Google and had the operators I wanted, but it gets very
slow at
Rocco Moretti wrote:
> rbt wrote:
>
>> The TV show on NBC in the USA running this week during primetime (Deal
>> or No Deal). I figure there are roughly 10, maybe 15 contestants. They
>> pick a briefcase that has between 1 penny and 1 million bucks and then
>> play this silly game where NBC tries
Chip Turner wrote:
> On 2005-12-26 15:05:21 -0500, [EMAIL PROTECTED] said:
>
>> I believe not; the Monty Hall problem is biased by the fact that the
>> presenter knows where the prize is, and eliminates one box accordingly.
>> Where boxes are eliminated at random, it's impossible for any given
>>
MonkeeSage wrote:
> On Oct 7, 12:37 pm, Fredrik Lundh <[EMAIL PROTECTED]> wrote:
>
>>for what?
>
>
> key in self.keys()
>
[snip]
No. The above constructs a list of keys and searches the list for the
key, O(n). "key in somedict" is a lookup, O(1).
Duncan
--
http://mail.python.org/mailman
MonkeeSage wrote:
>
> On Oct 7, 7:14 pm, Duncan Smith <[EMAIL PROTECTED]> wrote:
>
>>No. The above constructs a list of keys and searches the list for the
>>key, O(n). "key in somedict" is a lookup, O(1).
>
>
> My point wasn't in
[EMAIL PROTECTED] wrote:
> After researching Komodo, I found it's not free. The only funds I have
> are a college fund, and I can't start diping into that until I'm going
> to college. Any free AND good IDEs?
>
http://wiki.python.org/moin/IntegratedDevelopmentEnvironments
Duncan
--
http://mail.
[EMAIL PROTECTED] wrote:
> Zipping an xrange? I'm having trouble visualizing how you do that to
> avoid x*i+y.
>
> -Janto
>
Something like,
>>> lis = ['a', 'b', 'c', 'd']
>>> y = 3
>>> i = 7
>>> for n, item in zip(xrange(y, len(lis)*i+y, i), lis):
print n, item
3 a
10 b
17 c
python wrote:
[snip]
>
> How could I keep the list1 not to change when remove list2's elements?
>
You can't when the names list1 and list2 refer to the same list. Try
making list2 a copy of list1,
list2 = list(list1)
Duncan
--
http://mail.python.org/mailman/listinfo/python-list
Brian Quinlan wrote:
> This is less a Python question and more a optimization/probability
> question. Imaging that you have a list of objects and there frequency in
> a population e.g.
>
> lst = [(a, 0.01), (b, 0.05), (c, 0.50), (d, 0.30), (e, 0.04), (f, 0.10)]
>
> and you want to drawn n items f
Steven D'Aprano wrote:
> On Tue, 04 Jul 2006 03:06:37 -0700, aliassaf wrote:
>
>
>>Hello,
>>
>>If we write = x^2 and if I give to the program the values of x, it will
>>going to calculate the values of y, and also for x.
>>
>>But it is possible ? that is if I give to the program the values
[EMAIL PROTECTED] wrote:
> I am simulating an event where users come into the pool randomly
> starting at time T=0, i.e. For Example, 2 users came at T= 0 into the
> the pool, 3 users came at T= 1 into the the pool, 5 users came at T=2
> ,..,54 users came at T=45 etc. As cumulative number o
ahlongxp wrote:
> list=('a','d','c','d')
> for a in list:
> if a=='a' :
> #skip the letter affer 'a'
>
> what am I supposed to do?
>
Maybe,
>>> it = iter(['a','d','c','d'])
>>> for item in it:
print item
if item == 'a':
x = it.next()
[EMAIL PROTECTED] wrote:
> Consider the following:
>
a = {1:2, 3:4, 2:5}
>
>
> Say that i want to get the keys of a, sorted. First thing I tried:
>
>
b = a.keys().sort()
print b
>
> None
>
> Doesn't work. Probably because I am actually trying to sort the keys
> of the dictionary
Hello,
Since moving to numpy I've had a few problems with my existing
code. It basically revolves around the numpy scalar types. e.g.
>>> import Numeric as N
>>> a = N.array([[0,1],[2,3]])
>>> a
array([[0, 1],
[2, 3]])
>>> i = a[0,0]
>>
Travis E. Oliphant wrote:
> Duncan Smith wrote:
>
>> Hello,
>> Since moving to numpy I've had a few problems with my existing
>> code. It basically revolves around the numpy scalar types. e.g.
>>
>
> You will probably get more help on the num
Travis E. Oliphant wrote:
> Duncan Smith wrote:
>
>> Hello,
>> Since moving to numpy I've had a few problems with my existing
>> code. It basically revolves around the numpy scalar types. e.g.
>>
>
> You will probably get more help on the num
Roel Schroeven wrote:
> Pablo Torres schreef:
>
>> Hi guys!
>>
>> I am working on Conway's Game of Life right now and I've run into a
>> little problem.
>> I represent dead cells with 0s and live ones with 1s. Check this out:
>>
>> >>> grid = [[0] * 3] * 3
>> >>> grid
>> [[0, 0, 0], [0
[EMAIL PROTECTED] wrote:
> I'm confused about why i get a type error when i call an object's
> method. Here's the example code:
>
class Foo:
>
> def __init__(self):
> self.foo = []
> def foo(self):
> print "in foo!"
>
>
>
f = Foo()
dir(f)
>
Andrea wrote:
> Hi,
> I need to calculate this probability P!/{n \choose p}, varying both n
> and p, n takes values in this range [512:1024] and p in [2:12].
> So i write this code in python:
>
> def factorial(n):
> result=1
> if n==0: return 1
> for i in xrange(1, abs(n)+1):
>
Hendrik van Rooyen wrote:
> "Nick Craig-Wood" <[EMAIL PROTECTED]> wrote:
>
>
>>Paul Rubin wrote:
>>
>>> The fencepost method still seems to be simplest:
>>>
>>> t = sorted(random.sample(xrange(1,50), 4))
>>> print [(j-i) for i,j in zip([0]+t, t+[50])]
>>
>>Mmm, nice.
>>
>>Here is anothe
greg wrote:
> Gabriel Genellina wrote:
>
>> The 5th number is not "random".
>
>
> More precisely, the fifth number is not *independent*
> of the others. You can't have five independent random
> numbers that sum to 50; only four independent numbers
> plus a dependent one.
>
> --
> Greg
In the
Duncan Smith wrote:
> greg wrote:
>
>>Gabriel Genellina wrote:
>>
>>
>>>The 5th number is not "random".
>>
>>
>>More precisely, the fifth number is not *independent*
>>of the others. You can't have five independent random
&g
Hendrik van Rooyen wrote:
> "Duncan Smith" <[EMAIL PROTECTED]> wrote:
>
>
>
>>Yes, if the generating processes yield numbers from different
>>probability mass functions. You could simply look at the likelihood
>>ratio. Otherwise, the likelihood
Hello,
I am currently implementing (mainly in Python) 'models' that come
to me as Excel spreadsheets, with little additional information. I am
expected to use these models in a web application. Some contain many
worksheets and various macros.
What I'd like to do is extract the data and busi
John Machin wrote:
> On Apr 2, 1:59 am, Duncan Smith <[EMAIL PROTECTED]> wrote:
>
>>Hello,
>> I am currently implementing (mainly in Python) 'models' that come
>>to me as Excel spreadsheets, with little additional information. I am
>>expected t
[EMAIL PROTECTED] wrote:
> I am trying to write a basic anagram system, that takes a text file
> line by line and by sorting the string into its alphabetical form
> compares it to keys within a dictionary.
>
> If it matches a key I want to add it (in its unordered form) to a list
> for that key.
>
[EMAIL PROTECTED] wrote:
> attackwarningred napisa (a):
>
>
>>The array F(n) is dynamically allocated earlier on and is sized with
>>reference to shotcount, the number of iterations the model performs. The
>>problem is I can't get something like this to run in Python using numpy,
>>and for the si
Hello,
I find myself in the, for me, unusual (and at the moment unique)
position of having to write a web application. I have quite a lot of
existing Python code that will form part of the business logic. This
relies on 3rd party libraries (such as numpy) which would make porting
to e.g. Iro
Thanks all. It's looking like Turbogears at the moment (unless my boss
makes an executive decision). Cheers.
Duncan
--
http://mail.python.org/mailman/listinfo/python-list
Hello,
In moving from 2.4 to 2.5 I find that some of my unit tests are now
failing. I've worked out that the problem relates to the set update
method. In 2.4 I could update a set with an iterable type derived from
dict as the argument. I now find that the set is updated with the hash
values
Peter Otten wrote:
> Duncan Smith wrote:
>
>
>> In moving from 2.4 to 2.5 I find that some of my unit tests are now
>>failing. I've worked out that the problem relates to the set update
>>method. In 2.4 I could update a set with an iterable type derived fro
Don Taylor wrote:
> Does anyone know what is needed to install to get epydoc to generate pdf
> files on Windows. Besides epydoc itself of course.
>
> Maybe there is a more appropriate forum to ask newbie questions about
> epydoc?
>
As I remember, LaTeX and ghostscript.
Duncan
--
http://mail.p
John wrote:
> I want to write a code for Breadth First Traveral for Graph, which needs a
> queue to implement.
>
> I wonder that for such a powerful language as Python, whether there is a
> better and simpler implementation for a traditional FIFO queue?
>
For a BFS I coded up a while back iterat
Bruza wrote:
> I need to implement a "random selection" algorithm which takes a list
> of [(obj, prob),...] as input. Each of the (obj, prob) represents how
> likely an object, "obj", should be selected based on its probability
> of
> "prob".To simplify the problem, assuming "prob" are integers, an
Bruza wrote:
> On Nov 16, 4:47 pm, Bruza <[EMAIL PROTECTED]> wrote:
>> On Nov 16, 6:58 am, duncan smith <[EMAIL PROTECTED]>
>> wrote:
>>
>>
>>
>>> Bruza wrote:
>>>> I need to implement a "random selection" algorithm w
Roy Smith wrote:
> I noticed something interesting today. In C++, you write:
>
> try {
>throw foo;
> } catch {
> }
>
> and all three keywords are verbs, so when you describe the code, you can
> use the same English words as in the program source, "You try to execute
> some code, but it thr
[EMAIL PROTECTED] wrote:
> The original post only mentions deleting the values in the list, not
> the list itself. Given that you want to keep the list and just ditch
> the values it contains I'd go with:
>
> list1 = []
>
> -Linnorm
>
Which rebinds list1 to a new (empty) list. It doesn't clea
George Sakkis wrote:
> After a brief search, I didn't find any python package related to OLAP
> and pivot tables. Did I miss anything ? To be more precise, I'm not so
> interested in a full-blown OLAP server with an RDBMS backend, but
> rather a pythonic API for constructing datacubes in memory, sl
chris brat wrote:
> Doesnt this do what the original poster is try accomplish?
>
Not what the OP asked for, no. Clearing a list implies that list1
should still be bound to the same list (which might be important if
there are other names bound to the same list). If it wasn't important
that it be
Carl Banks wrote:
> On Jan 18, 7:01 pm, Paddy <[EMAIL PROTECTED]> wrote:
>> On Jan 18, 9:47 pm, [EMAIL PROTECTED] wrote:> Tim,
>>
>>> Thanks for the topsort code. It would be useful in a project I'm
>>> working on. Can I use the code for free under public domain? Thanks!
>> When I needed one I d
malkarouri wrote:
> Hi everyone,
>
> I have an algorithm in which I need to use a loop over a queue on
> which I push values within the loop, sort of:
>
> while not(q.empty()):
> x = q.get()
> #process x to get zero or more y's
> #for each y:
> q.put(y)
>
> The easiest thing I ca
RC wrote:
> unsortedList = list(["XYZ","ABC"])
>
> sortedList = unsortedList.sort()
> print sortedList
>
>
> Why this return None?
Because the sort method sorts the list in place (and returns None).
> How do I get return as ["ABC", "XYZ"]?
>>> unsortedList = ["XYZ","ABC"]
>>> unsortedList.sor
Simon Forman wrote:
On May 21, 4:36 am, Bruno Desthuilliers wrote:
Simon Forman a écrit :
On May 20, 8:58 am, Paul McGuire <[EMAIL PROTECTED]> wrote:
On May 20, 10:50 am, [EMAIL PROTECTED] wrote:
You don't need all those conditionals. A set differs from a list
precisely in the fact that e
marc wyburn wrote:
HI all, I'm a bit stuck with how to work out boolian logic.
I'd like to say if A is not equal to B, C or D:
do something.
I've tried
if not var == A or B or C:
and various permutations but can't seem to get my head around it. I'm
pretty sure I need to know what is calula
Michael Press wrote:
In article <[EMAIL PROTECTED]>,
Mark Wooding <[EMAIL PROTECTED]> wrote:
Michael Press <[EMAIL PROTECTED]> wrote:
I already compiled and installed the GNU multiprecision library
on Mac OS X, and link to it in C programs.
How do I link to the library from Python?
You kn
[EMAIL PROTECTED] wrote:
> Thank you both, the assigning using slicing works perfectly (as I'm
> sure you knew it would)... It just didn't occur to me because it
> seemed a little nonintuitive... The specific application was
>
> def dicttolist (inputdict):
> finallist=[]
> for k, v in inpu
Manuel Ebert wrote:
> Dear list,
>
> who's got aesthetic advice for the following problem? I've got some
> joint probabilities of two distinct events Pr(X=x, Y=y), stored in a
> list of lists of floats, where every row represents a possible outcome
> of X and every float in a row a possible outcom
John Salerno wrote:
> After reading the PEP, I'm still not quite sure if there is a
> recommended (or widely preferred) method of naming variables. Here are
> the relevant bits:
>
>> Global Variable Names
>>
>> (Let's hope that these variables are meant for use inside one
>> module
>>
John Salerno wrote:
> I'm working on another exercise now about generating random numbers for
> the lottery. What I want to do is write a function that picks 5 random
> numbers from 1-53 and returns them. Here's what I have so far:
>
> numbers = range(1, 54)
>
> def genNumbers():
> for x in r
James wrote:
> Perhaps use the phrase "whole number" there and mention that in
> programming they're called integers. Having a glossary with
> definitions for things like integer, float etc etc. would be good if
> when you talked about integers it linked to the glossary. And
> similarly use "decima
Clodoaldo Pinto wrote:
> Duncan Smith wrote:
>
>>James wrote:
>>
>>>Perhaps use the phrase "whole number" there and mention that in
>>>programming they're called integers. Having a glossary with
>>>definitions for things like integ
John Salerno wrote:
> Steven Bethard wrote:
>
>
>> lst[:] = []
>> lst = []
>
>
> What's the difference here?
>>> lst = [1,2,3]
>>> lst2 = lst
>>> lst[:] = []
>>> lst2
[]
>>> lst = [1,2,3]
>>> lst2 = lst
>>> lst = []
>>> lst2
[1, 2, 3]
>>>
Duncan
--
http://mail.python.org/mailman/list
Hello,
I'm trying to find a clean and reliable way of uncovering
information about 'extremal' values for floats on versions of Python
earlier than 2.6 (just 2.5 actually). I don't want to add a dependence
on 3rd party modules just for this purpose. e.g. For the smallest
positive float
Christian Heimes wrote:
duncan smith wrote:
Hello,
I'm trying to find a clean and reliable way of uncovering
information about 'extremal' values for floats on versions of Python
earlier than 2.6 (just 2.5 actually). I don't want to add a dependence
on 3rd party m
Steven D'Aprano wrote:
On Sun, 07 Feb 2010 03:02:05 +0000, duncan smith wrote:
The precise issue is that I'm supplying a default value of
2.2250738585072014e-308 for a parameter (finishing temperature for a
simulated annealing algorithm) in an application. I develop on
Ubuntu64,
Alex Hall wrote:
On 5/22/10, MRAB wrote:
Lanny wrote:
The answer may be right infront of me but I really can't figure this
out.
I'm trying to build a interactive fiction kind of game, silly I know
but I
am a fan of the genre. I'm trying to build up an index of all the
rooms in
the game from an
southof40 wrote:
I have list of of N Vehicle objects - the only possible vehicles are
cars, bikes, trucks.
I want to select an object from the list with a probability of : cars
0.7, bikes 0.3, trucks 0.1.
I've currently implemented this by creating another list in which each
car object from the
duncan smith wrote:
southof40 wrote:
I have list of of N Vehicle objects - the only possible vehicles are
cars, bikes, trucks.
I want to select an object from the list with a probability of : cars
0.7, bikes 0.3, trucks 0.1.
I've currently implemented this by creating another list in
Thomas wrote:
Hello all.
Trying to find slope of function using numpy.
Getting close, but results are a bit off. Hope someone out here can
help.
[snip]
Why are you generating y-coordinates from the x-coordinates [-6, -5, -4,
-3, -2, -1, 0, 1, 2, 3, 4]? If you're going to use the x-coordina
A little off-topic perhaps, but I can't think of anywhere more likely to
contain people with answers.
I've just upgraded to Jaunty Jackalope where Python 2.6 is the default
Python version. I'm still developing under 2.5, but IDLE now refuses to
respond to left click events (for code editing, menu
Michiel Overtoom wrote:
>
> Duncan Smith wrote:
>
>> IDLE now refuses to
>> respond to left click events (for code editing, menus etc. respond as
>> expected). If I right click, then left click I can move the cursor, but
>> that's not ideal.
>>
>
Russ P. wrote:
> I need to speed up some Python code, and I discovered Psyco. However,
> the Psyco web page has not been updated since December 2007. Before I
> go to the trouble of installing it, does anyone know if it is still
> good for Python 2.6.1? Thanks.
If you look at http://psyco.sourcefo
kpp9c wrote:
> Very simple finite automaton (?)
>
> I am not sure if this is and example of Finite Automaton or a Finite
> State Machine or perhaps it is related to a transition table or markov
> process. I am not a math person so i am not sure what it is called. I
> googled around and got lots of
On 15/02/17 13:27, spiess.benja...@googlemail.com wrote:
> Hello !:)
> I've got a problem which I would really like to solve.
> I got a cloud of points (in the simplest example its a 2-dimensional cloud of
> points).
> First, I want to set one of the points as the initial (or middle) point.
> S
On 24/03/17 19:35, Tim Chase wrote:
> Playing around, I came across the following
>
> $ python3
> Python 3.4.2 (default, Oct 8 2014, 10:45:20)
> [GCC 4.9.1] on linux
> Type "help", "copyright", "credits" or "license" for more information.
from dis import dis
def f(x):
> ... return
Hello,
I need to code up a table class, which will be based on numpy
arrays. Essentially it needs to behave like a numpy array, but with a
variable associated with each array dimension. It must (at least
partially) satisfy the API of an existing class. The main reason for the
new class is to
On 24/11/2023 14:31, Loris Bennett wrote:
Hi,
I want to print some records from a database table where one of the
fields contains a JSON string which is read into a dict. I am doing
something like
print(f"{id} {d['foo']} {d['bar']}")
However, the dict does not always have the same keys, so
101 - 200 of 201 matches
Mail list logo