diff --git a/Handle_emg_data.py b/Handle_emg_data.py index d0a3658..aee355e 100644 --- a/Handle_emg_data.py +++ b/Handle_emg_data.py @@ -1,5 +1,6 @@ import pandas as pd from pathlib import Path +import numpy as np from pandas.core.frame import DataFrame @@ -42,8 +43,8 @@ def get_emg_str(emg_nr): return 'emg' + str(emg_nr) def get_min_max_timestamp(df:DataFrame): - min = df['timestamp'].min() - max = df['timestamp'].max() + min = int(np.floor(df['timestamp'].min())) + max = int(np.ceil(df['timestamp'].max())) return min, max diff --git a/Signal_prep.py b/Signal_prep.py index a109e11..731fe58 100644 --- a/Signal_prep.py +++ b/Signal_prep.py @@ -100,7 +100,6 @@ def load_user_emg_data(): def prep_df_for_trans(df:DataFrame): sample_rate = SAMPLE_RATE min, duration = Handler.get_min_max_timestamp(df) - print(duration) x = np.linspace(0, duration, SAMPLE_RATE * duration, endpoint=False) y = np.array(df.iloc(1)) return x, y, duration diff --git a/__pycache__/Handle_emg_data.cpython-38.pyc b/__pycache__/Handle_emg_data.cpython-38.pyc index 4cdcc45..0a160b7 100644 Binary files a/__pycache__/Handle_emg_data.cpython-38.pyc and b/__pycache__/Handle_emg_data.cpython-38.pyc differ