I stumbled upon this one-liner:
[float(n)-50 for n in range(100)]
Could somebody tell me what it does? It’s supposed to return a float value for a vector.
Best,
Marius
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
That’s a list comprehension that reads “create a list of 100 elements such that for each element at index
n, set that element equal to n-50″.