I am trying to initialize a numpy array or a list with ascending values. The number of values is n.
e.g: If n = 10
[0,2,4,6,8,10,12,14,16,18]
If n = 2
[0,2]
I am aware that I could use a for like this:
result = []
for x in range(n):
result.append(x*2)
But when n gets larger this would take a while so I was looking for a faster way.
np.arange()