<jupyter_start><jupyter_text>1D Random walk smaller title$ \sum_1^100{1+i}$<jupyter_code>np.random.rand()
stepsize = 1
numsteps = 100
position = []
x = 0
for i in range(numsteps):
    number = np.random.rand()
    if number < 0.5:
        x = x - stepsize
    else:
        x = x + stepsize
    position = position + [x]
    # could have typed
    # position.append(x)
    
plt.plot(position)
pos = np.array(position)
np.average(pos)
pos[-10]
np.std(pos)
df = pd.DataFrame(pos)
df.plot()
df.rolling(window=10).mean().plot()
roll = df.rolling(window=10)
m = roll.mean()
m.plot()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.15980230642504117, 'fraction_numerical': 0.03130148270181219, 'mean_word_length': 3.4705882352941178, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '635596', 'license': 'Apache-2.0', 'n_tokens_mistral': 251, 'n_tokens_neox': 237, 'n_words': 51, 'path': 'Diffusion/ClassFeb8.ipynb', 'repo_name': 'topatomer/IntroToBiophysics', 'size': '607'}