Difference in output between numpy linspace and numpy logspace

后端 未结 4 1803
梦毁少年i
梦毁少年i 2021-01-04 04:46

Numpy linspace returns evenly spaced numbers over a specified interval. Numpy logspace return numbers spaced evenly on a log scale.

I don\'t understand why numpy log

4条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-04 05:12

    From documentation for numpy.logspace() -

    numpy.logspace(start, stop, num=50, endpoint=True, base=10.0, dtype=None)

    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).

    For your case, base is defaulting to 10, so its going from 10 raised to 0.02 to 10 raised to 2 (100).

提交回复
热议问题