Удалил Untitled.ipynb
This commit is contained in:
BIN
src-numpy/array_archive.npz
Normal file
BIN
src-numpy/array_archive.npz
Normal file
Binary file not shown.
BIN
src-numpy/arrays_compressed.npz
Normal file
BIN
src-numpy/arrays_compressed.npz
Normal file
Binary file not shown.
8
src-numpy/random_walk_numpy.py
Normal file
8
src-numpy/random_walk_numpy.py
Normal file
@@ -0,0 +1,8 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import numpy as np
|
||||
|
||||
nsteps = 1000
|
||||
draws = np.random.randint(0, 2, size=nsteps)
|
||||
steps = np.where(draws > 0, 1, -1)
|
||||
walk = steps.cumsum()
|
||||
17
src-numpy/random_walk_pure.py
Normal file
17
src-numpy/random_walk_pure.py
Normal file
@@ -0,0 +1,17 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import matplotlib.pyplot as plt
|
||||
import random
|
||||
|
||||
position = 0
|
||||
walk = [position]
|
||||
steps = 1000
|
||||
for i in range(100):
|
||||
step = 1 if random.randint(0, 1) else -1
|
||||
position += step
|
||||
walk.append(position)
|
||||
|
||||
plt.plot(walk[:100])
|
||||
plt.savefig('numpy-3.png')
|
||||
|
||||
|
||||
BIN
src-numpy/some_array.npy
Normal file
BIN
src-numpy/some_array.npy
Normal file
Binary file not shown.
Reference in New Issue
Block a user