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
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
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