Skip to content
Snippets Groups Projects
Commit c1921d40 authored by Tom Nellius's avatar Tom Nellius
Browse files

Explain difference between arange() and linspace()

parent 03dc9aec
No related branches found
No related tags found
No related merge requests found
......@@ -31,8 +31,8 @@ ones_array = np.ones((rows, cols), dtype = np.uint64)
- Other usefull stuff
```python
np.arange(10,25,step=5) # evenly spaced values
np.linspace(0,2,num=9, dtype) # evenly spaced values
np.arange(10,25,step=5) # evenly spaced values. Specify the stepsize
np.linspace(0,2,num=9, dtype) # evenly spaced values. Specify the number of values
np.eye(2, dtype) # 2x2 identity matrix
np.random.random((2,2)) # 2x2 array with random [0..1) values
np.random.randint(low, high, (2, 2)) # 2x2 array with random integers from [low, high[ (w/o high!)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment