import numpy as np
array ([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
array (, dtype = int64)
Can you tell me if you know how to create a negative array?
If i don't use Numpy, you could do it like this ...
[i for i in range (-1, -10, -2)]
Answer # 1
Three arguments, start, stop, and step can be passed as needed.
>>>import numpy as np >>>np.arange (-10, 0) array ([-10, -9, -8, -7, -6, -5, -4, -3, -2, -1])
numpy.arange — NumPy v1.17 Manual
- python : Implementing SVM from scratch using pytorch
- python : Attempt to get argmax of an Empty Sequence ARGMAX value remains empty and can not be executed.
- python : How to add to the matrix column numbers
- python : How to create a random two-dimensional array NUMPY?
- python : How to find out the coefficients of a piecewise line function during the approximation of the sample?
- Using the symbolic variables matrix in Python
- python : NUMPY column names
- Python, NUMPY How to implement this algorithm?
- python : VWAP calculation, ends with RAM, the code is performed too long
- python : Summation by Vector NUMPY Indexes