<jupyter_start><jupyter_text>Author[<NAME>](https://koenaerts.ca/) @ [Mobia Technology Innovations](https://mobia.io)[myOpenHealth](https://mobia.io/healthcare/)  IntroThis notebook plots some of the individual heartbeat records that were generated from the "02_import_mitdb_data" notebook.  InitializeImport dependencies.<jupyter_code>import numpy as np
from matplotlib import pyplot as plt<jupyter_output><empty_output><jupyter_text>Load DataChange file name to select different file. The file must be CSV and each row should contain exactly 188 values.<jupyter_code>data = np.loadtxt('data_ecg/210_MLII.csv', delimiter=',')
print(data.shape)<jupyter_output><empty_output><jupyter_text>VisualizeChange values to navigate around the data. Different colors are used for Normal vs Abnormal heartbeats.<jupyter_code>for beatid in [0,1,2,3,99,200,502,2428,2443]:
    times = np.arange(187, dtype = 'float') / 187
    beat = data[beatid][:-1]
    anno = data[beatid][-1]
    plt.figure(figsize=(20,5))
    if (anno == 0.0):
      plt.plot(times, beat, 'b')
    else:
      plt.plot(times, beat, 'r')
    plt.xlabel('Time [s]')
    plt.ylabel('beat ' + str(beatid) + " type " + str(anno))
    plt.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13436482084690554, 'fraction_numerical': 0.033387622149837134, 'mean_word_length': 5.270408163265306, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 14, 'https://': 3, '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': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '4298', 'license': 'MIT', 'n_tokens_mistral': 444, 'n_tokens_neox': 419, 'n_words': 99, 'path': '03_view_imported_data.ipynb', 'repo_name': 'JiaminXu1019/ECG_ML', 'size': '1232'}