numpy.logspace() in Python Last Updated : 05 Apr, 2022 Comments Improve Suggest changes Like Article Like Report The numpy.logspace() function returns number spaces evenly w.r.t interval on a log scale. Syntax : numpy.logspace(start, stop, num = 50, endpoint = True, base = 10.0, dtype = None) Parameters : -> start : [float] start(base ** start) of interval range. -> stop : [float] end(base ** stop) of interval range -> endpoint : [boolean, optional]If True, stop is the last sample. By default, True -> num : [int, optional] No. of samples to generate -> base : [float, optional] Base of log scale. By default, equals 10.0 -> dtype : type of output array Return : -> ndarray Code 1 : Explaining the use of logspace() Python # Python Programming illustrating # numpy.logspace method import numpy as geek # base = 11 print("B\n", geek.logspace(2.0, 3.0, num=5, base = 11)) # base = 10 print("B\n", geek.logspace(2.0, 3.0, num=5)) # base = 10, dtype = int print("B\n", geek.logspace(2.0, 3.0, num=5, dtype = int)) Output : B [ 121. 220.36039471 401.31159963 730.8527479 1331. ] B [ 100. 177.827941 316.22776602 562.34132519 1000. ] B [ 100 177 316 562 1000] Code 2 : Graphical Representation of numpy.logspace() using matplotlib module - pylab Python # Graphical Representation of numpy.logspace() import numpy as geek import pylab as p # Start = 0 # End = 2 # Samples to generate = 10 x1 = geek.logspace(0, 1, 10) y1 = geek.zeros(10) # Start = 0.1 # End = 1.5 # Samples to generate = 12 x2 = geek.logspace(0.1, 1.5, 12) y2 = geek.zeros(12) p.plot(x1, y1+0.05, 'o') p.xlim(-0.2, 18) p.ylim(-0.5, 1) p.plot(x2, y2, 'x') Output : Note : These NumPy-Python programs won’t run on online IDE's, so run them on your systems to explore themSimilar methods : arangelinspace Comment More infoAdvertise with us Next Article numpy.logspace() in Python M mohit gupta_omg :) Follow Improve Article Tags : Python Python-numpy Python numpy-arrayCreation Practice Tags : python Similar Reads numpy.log1p() in Python numpy.log1p(arr, out = None, *, where = True, casting = 'same_kind', order = 'K', dtype = None, ufunc 'log1p') : This mathematical function helps user to calculate natural logarithmic value of x+1 where x belongs to all the input array elements. log1p is reverse of exp(x) - 1. Parameters : array : [ 2 min read numpy.log() in Python The numpy.log() is a mathematical function that helps user to calculate Natural logarithm of x where x belongs to all the input array elements. Natural logarithm log is the inverse of the exp(), so that log(exp(x)) = x. The natural logarithm is log in base e. Syntax :numpy.log(x[, out] = ufunc 'log1 4 min read numpy.log2() in Python numpy.log2(arr, out = None, *, where = True, casting = 'same_kind', order = 'K', dtype = None, ufunc 'log1p') : This mathematical function helps user to calculate Base-2 logarithm of x where x belongs to all the input array elements. Parameters : array : [array_like]Input array or object. out : [nda 2 min read numpy.logaddexp() in Python numpy.logaddexp() function is used to calculate Logarithm of the sum of exponentiations of the inputs. This function is useful in statistics where the calculated probabilities of events may be so small as to exceed the range of normal floating point numbers. In such cases, the logarithm of the calcu 2 min read numpy.log10() in Python About : numpy.log10(arr, out = None, *, where = True, casting = 'same_kind', order = 'K', dtype = None, ufunc 'log10') : This mathematical function helps user to calculate Base-10 logarithm of x where x belongs to all the input array elements. Parameters : array : [array_like]Input array or object. 2 min read numpy.logaddexp2() in Python numpy.logaddexp2() function is used to calculate Logarithm of the sum of exponentiations of the inputs in base-2. This function is useful in machine learning when the calculated probabilities of events may be so small as to exceed the range of normal floating point numbers. In such cases, the base-2 2 min read numpy.geomspace() in Python numpy.geomspace() is used to return numbers spaced evenly on a log scale (a geometric progression). This is similar to numpy.logspace() but with endpoints specified directly. Each output sample is a constant multiple of the previous.  Syntax : numpy.geomspace(start, stop, num=50, endpoint=True, dty 2 min read Logging in Python Logging is a means of tracking events that happen when some software runs. Logging is important for software developing, debugging, and running. If you don't have any logging record and your program crashes, there are very few chances that you detect the cause of the problem. And if you detect the c 8 min read Python | Numpy np.logseries() method With the help of np.logseries() method, we can get the log series in the form of an array by using np.logseries() method. Syntax : np.logseries(p, size) Return : Return an array of log series. Example #1 : In this example we can see that by using np.logseries() method, we are able to get an array of 1 min read Python Pytorch logspace() method PyTorch is an open-source machine learning library developed by Facebook. It is used for deep neural network and natural language processing purposes. The function torch.logspace() returns a one-dimensional tensor of steps points logarithmically spaced with base base between {\text{base}}^{\text{sta 2 min read Like