Home > Article > Backend Development > What does arange mean in python?
The arange function is used to create arithmetic arrays. It is used very frequently. arange is very similar to the range function. People who know python must often use the range function. For example, in the for loop, range is almost always used. Below we use range. Learn about arange. The difference between the two is that arange returns a data, while range returns a list.
arrange
Function description: arange([start,] stop[, step,], dtype=None) according to start Generate an ndarray with the range specified by stop and the step size set by step. dtype: dtype
Introduce numpy first. Another difference between arange and range is that arange is introduced before using it. Range does not need to be
Related recommendations: "python video tutorial"
Use a parameter to see how range and arange perform. range returns a list of 5 numbers from 0 to 4, while arange returns an array object. But their elements are the same.
Try entering two parameters. The first parameter is the starting point, and the second parameter is the ending point
Let’s try another starting point
If we enter three parameters, the third parameter becomes the step length
The above is the detailed content of What does arange mean in python?. For more information, please follow other related articles on the PHP Chinese website!