2021-06-22 13:32:51 +00:00
|
|
|
import pandas as pd
|
2021-06-22 18:31:16 +00:00
|
|
|
from pathlib import Path
|
|
|
|
|
|
|
|
class CSV_handler:
|
|
|
|
|
|
|
|
self.working_dir
|
|
|
|
|
2021-06-22 18:54:42 +00:00
|
|
|
def __init__(self):
|
2021-06-22 18:31:16 +00:00
|
|
|
self.working_dir = str(Path.cwd())
|
|
|
|
|
|
|
|
def make_df(self, filename)
|
|
|
|
filepath = self.working_dir + str(filename)
|
|
|
|
df = pd.read_csv(filepath)
|
|
|
|
return df
|
2021-06-22 18:54:42 +00:00
|
|
|
|
|
|
|
def get_time_emg_table(self, filename, emg_nr):
|
2021-06-22 18:31:16 +00:00
|
|
|
|
2021-06-22 18:54:42 +00:00
|
|
|
tot_data_frame = make_df(self, filename)
|
|
|
|
emg_str = "emg" + str(emg_nr)
|
|
|
|
filtered_df = tot_data_frame[emg_str]
|
|
|
|
return filtered_df
|
2021-06-22 18:31:16 +00:00
|
|
|
|
|
|
|
|
2021-06-22 13:32:51 +00:00
|
|
|
|
|
|
|
|