NumPy arrange(), linspace and logspace Functions

Machine Learning courses with 100+ Real-time projects Start Now!!

Program 1

# arange() , linspace(), logspace()
# use to create a array with Numerical values
# return type of all above functios are range value
#np.arange(start,stop,step,type)

import numpy as np

ar=np.logspace(1,5,5,dtype="int")
print(ar)

#linespace
# ar=np.linspace(1,10,5,dtype="float")
# print(ar)
# print("------------------------------------")

# ar1=np.arange(1,10,5,dtype="int32")
# print(ar1)

#ar=np.arange(1,100,2,dtype="int32")
# ar=np.arange(10,1,-1,dtype="int32")
# print(ar)
# print(ar.dtype)
# print(ar.itemsize)

 

Did you like our efforts? If Yes, please give DataFlair 5 Stars on Google

courses

DataFlair Team

DataFlair Team provides high-impact content on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. We make complex concepts easy to grasp, helping learners of all levels succeed in their tech careers.

Leave a Reply

Your email address will not be published. Required fields are marked *