Last answered:

29 Dec 2022

Posted on:

16 Aug 2022

6

np.arange - error - please clarify

I am getting error when i enter only the start argument for arange function - this is not same as what is shown in video - please clarify
e.g,.
array_rng = np.arange(start =30)
array_rng

after running above command - getting error

but on the other hand if i enter only stop argument - it runs smoothly - like below
array_rng = np.arange(stop =30)
array_rng

3 answers ( 0 marked as helpful)
Posted on:

19 Aug 2022

2

This is happening to me as well.

Posted on:

23 Dec 2022

0

image.png

Same here; its because the mandatory one is Stop

Posted on:

29 Dec 2022

3

The video is old. You need to have the stop parameter (start is optional). Actually, these are equivalent --> array_rng = np.arange(30) and array_rng = np.arange(stop = 30).
If the start parameter is not specified, the start value is 0.

Submit an answer