Update README.md

Signed-off-by: David Rotermund <54365609+davrot@users.noreply.github.com>
This commit is contained in:
David Rotermund 2023-12-14 21:04:59 +01:00 committed by GitHub
parent 63a68493d5
commit 16abbef114
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -98,6 +98,24 @@ numpy.linspace(start, stop, num=50, endpoint=True, retstep=False, dtype=None, ax
> >
> If True, stop is the last sample. Otherwise, it is not included. Default is True. > If True, stop is the last sample. Otherwise, it is not included. Default is True.
An example:
```python
import numpy as np
print(np.linspace(0, 1, num=10, endpoint=False)) # -> [0. 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9]
print(np.arange(0, 10) / 10) # -> [0. 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9]
```
Be mindful concerning the endpoint setting (**Notice the ... 8 10]**):
```python
import numpy as np
print(np.linspace(0, 10, num=10, endpoint=False, dtype=int)) # -> [0 1 2 3 4 5 6 7 8 9]
print(np.linspace(0, 10, num=10, endpoint=True, dtype=int)) # -> [ 0 1 2 3 4 5 6 7 8 10]
```
## [numpy.logspace](https://numpy.org/doc/stable/reference/generated/numpy.logspace.html) ## [numpy.logspace](https://numpy.org/doc/stable/reference/generated/numpy.logspace.html)
```python ```python