braket an matrix in python

Parisa Ch chapardar.parisa at gmail.com
Mon Feb 3 11:55:39 EST 2020


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 [] ?


More information about the Python-list mailing list