What is the meaning of slice(-4, 4, 0.25)?
What is the meaning of slice(-4, 4, 0.25)? In most python tutorial, slice is described as a notation, such as myarray[1:] for the sub-array of myarray starting from the 2nd element. Now I need to invoke scipy.optimize.brute which needs a slice object in its arguments. Its example code uses "slice(-4,4,0.25)". It looks like numpy.arange(-4,4,0.25) to me, but I cannot find documentation about it. What does it represent exactly? By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.