Re: braket an matrix in python

2020-02-11 Thread Parisa Ch
On Monday, February 3, 2020 at 9:46:43 PM UTC+3:30, Peter Otten wrote: > 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

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