Important Notice:

Course Content
NumPy Basic in Python (Chapter-13) M3-R5
About Lesson

Np.linspace:- linspace() function returns values between a given range and with a same gap between consecutive elements.

Syntax: numpy.linspace(start,stop,num,endpoint,retstep,dtype)

import numpy as np

a=np.linspace(5,15,5)

print(a)

Output

[ 5.   7.5 10.  12.5 15. ]

 

import numpy as np

a=np.linspace(5,15,5,endpoint=False)

print(a)

Output

[ 5.  7.  9. 11. 13.]

 

 

error: Content is protected !!