<jupyter_start><jupyter_text>예제 2-1<jupyter_code>dt, ts, sonar_data = load_sonar_data()

ma = MovingAverageFilter(10)
averaged = []
for x in sonar_data:
    ma.update(x)
    averaged.append(ma.get())

fig = plt.figure(figsize=[16, 9])
plt.plot(ts, sonar_data, 'ro', label="measured")
plt.plot(ts, averaged, 'b-', label="averaged")
plt.legend()
plt.ylabel("Distance[m]")
plt.xlabel("Time[sec]")
plt.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1912442396313364, 'fraction_numerical': 0.016129032258064516, 'mean_word_length': 6.767857142857143, 'pattern_counts': {'":': 0, '<': 5, '<?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': '574480', 'license': 'Unlicense', 'n_tokens_mistral': 200, 'n_tokens_neox': 187, 'n_words': 29, 'path': '02.ipynb', 'repo_name': 'jinhwanlazy/kalman-filter-isnt-hard', 'size': '434'}