MCPcopy
hub / github.com/numpy/numpy / logspace

Function logspace

numpy/_core/function_base.py:197–303  ·  view source on GitHub ↗

Return numbers spaced evenly on a log scale. In linear space, the sequence starts at ``base ** start`` (`base` to the power of `start`) and ends with ``base ** stop`` (see `endpoint` below). .. versionchanged:: 1.25.0 Non-scalar 'base` is now supported Parameters

(start, stop, num=50, endpoint=True, base=10.0, dtype=None,
             axis=0)

Source from the content-addressed store, hash-verified

195
196@array_function_dispatch(_logspace_dispatcher)
197def logspace(start, stop, num=50, endpoint=True, base=10.0, dtype=None,
198 axis=0):
199 """
200 Return numbers spaced evenly on a log scale.
201
202 In linear space, the sequence starts at ``base ** start``
203 (`base` to the power of `start`) and ends with ``base ** stop``
204 (see `endpoint` below).
205
206 .. versionchanged:: 1.25.0
207 Non-scalar 'base` is now supported
208
209 Parameters
210 ----------
211 start : array_like
212 ``base ** start`` is the starting value of the sequence.
213 stop : array_like
214 ``base ** stop`` is the final value of the sequence, unless `endpoint`
215 is False. In that case, ``num + 1`` values are spaced over the
216 interval in log-space, of which all but the last (a sequence of
217 length `num`) are returned.
218 num : integer, optional
219 Number of samples to generate. Default is 50.
220 endpoint : boolean, optional
221 If true, `stop` is the last sample. Otherwise, it is not included.
222 Default is True.
223 base : array_like, optional
224 The base of the log space. The step size between the elements in
225 ``ln(samples) / ln(base)`` (or ``log_base(samples)``) is uniform.
226 Default is 10.0.
227 dtype : dtype
228 The type of the output array. If `dtype` is not given, the data type
229 is inferred from `start` and `stop`. The inferred type will never be
230 an integer; `float` is chosen even if the arguments would produce an
231 array of integers.
232 axis : int, optional
233 The axis in the result to store the samples. Relevant only if start,
234 stop, or base are array-like. By default (0), the samples will be
235 along a new axis inserted at the beginning. Use -1 to get an axis at
236 the end.
237
238 Returns
239 -------
240 samples : ndarray
241 `num` samples, equally spaced on a log scale.
242
243 See Also
244 --------
245 arange : Similar to linspace, with the step size specified instead of the
246 number of samples. Note that, when used with a float endpoint, the
247 endpoint may or may not be included.
248 linspace : Similar to logspace, but with the samples uniformly distributed
249 in linear space, instead of log space.
250 geomspace : Similar to logspace, but with endpoints specified directly.
251 :ref:`how-to-partition`
252
253 Notes
254 -----

Callers 8

test_basicMethod · 0.90
test_start_stop_arrayMethod · 0.90
test_base_arrayMethod · 0.90
test_stop_base_arrayMethod · 0.90
test_dtypeMethod · 0.90
test_subclassMethod · 0.90
geomspaceFunction · 0.85

Calls 2

linspaceFunction · 0.85
astypeMethod · 0.80

Tested by 7

test_basicMethod · 0.72
test_start_stop_arrayMethod · 0.72
test_base_arrayMethod · 0.72
test_stop_base_arrayMethod · 0.72
test_dtypeMethod · 0.72
test_subclassMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…