Re: braket an matrix in python

2020-02-03 Thread Peter Otten
Parisa Ch wrote: > x=np.linspace(0,2*math.pi,n) > n=len(x) > r=int(math.ceil(f*n)) > h=[np.sort(np.abs(x-x[i]))[r] for i in range(n)] > > this is part of a python code. the last line is confusing? x is a matrix > and x[i] is a number. how calculate x-x[i] for each i? > why the put r in [] ? Br

braket an matrix in python

2020-02-03 Thread Parisa Ch
x=np.linspace(0,2*math.pi,n) n=len(x) r=int(math.ceil(f*n)) h=[np.sort(np.abs(x-x[i]))[r] for i in range(n)] this is part of a python code. the last line is confusing? x is a matrix and x[i] is a number. how calculate x-x[i] for each i? why the put r in [] ? -- https://mail.python.org/mailman

Re: when uses time.clock,there are always mistakes

2020-02-03 Thread Peter Otten
石盼 wrote: > The problem like this: > t = time.clock() > AttributeError: module 'time' has no attribute 'clock' Quoting https://docs.python.org/3/whatsnew/3.8.html#api-and-feature-removals """ The function time.clock() has been removed, after having been deprecated since Python 3.3: use time.pe

Re: when uses time.clock,there are always mistakes

2020-02-03 Thread Rhodri James
On 03/02/2020 08:04, 石盼 wrote: Hello !  The problem like this:   RESTART: Shell   >>> import time   >>> t = time.clock()   Traceback (most recent call last):   File "", line 1, in  

Re: no explanation towards not installing my application//

2020-02-03 Thread Bob Gailer
On Feb 3, 2020 8:18 AM, "the python app i had downloaded is not opening!" < mbharathi1...@gmail.com> wrote: I'm assuming you're using Windows 10. Correct? You're telling us you downloaded the program installer. Did you run the installer? Where did it tell you it was putting the program? Exactly

no explanation towards not installing my application//

2020-02-03 Thread the python app i had downloaded is not opening!
Sent from Mail for Windows 10 -- https://mail.python.org/mailman/listinfo/python-list

when uses time.clock,there are always mistakes

2020-02-03 Thread 石盼
Hello !  The problem like this:   RESTART: Shell   >>> import time   >>> t = time.clock()   Traceback (most recent call last):   File "", line 1, in   t = time.clock()   A

Re: lxml - minor problem appending new element

2020-02-03 Thread Frank Millman
On 2020-02-03 10:39 AM, Peter Otten wrote: Frank Millman wrote: This is a minor issue, and I have found an ugly workaround, but I thought I would mention it. Like this? children = list(xml) for y in children: print(etree.tostring(y)) if y.get('z') == 'c': child = etree.Ele

Re: lxml - minor problem appending new element

2020-02-03 Thread Peter Otten
Frank Millman wrote: > Hi all > > I usually send lxml queries to the lxml mailing list, but it appears to > be not working, so I thought I would try here. > > This is a minor issue, and I have found an ugly workaround, but I > thought I would mention it. Like this? children = list(xml) for y i