Skip to content
Snippets Groups Projects

Sc 187/cleanup and docstrings

Closed Nijsen, T.J.P. (Thomas) requested to merge SC-187/cleanup-and_docstrings into review-window
1 file
+ 7
8
Compare changes
  • Side-by-side
  • Inline
+ 7
8
@@ -17,19 +17,19 @@ class FileReader (ABC):
"""Take the relevant data out of the imported data.
Args:
data: Dataframe of imported data
data: DataFrame of imported data
Returns:
extraction: Dataframe of only the relevant data
extraction: DataFrame of only the relevant data
"""
pass
@staticmethod
def df_to_words(df, type_code='source'):
"""Convert the rows in a dataframe to word instances
"""Convert the rows in a DataFrame to Word instances.
Args:
df: Dataframe with the onset, offset and string of a Word
df: DataFrame with the onset, offset and string of a Word
type_code: Role of files ('source' or 'shadow')
Returns:
@@ -76,10 +76,10 @@ class CSVReader(FileReader):
data.
Args:
data: Dataframe of imported .csv data
data: DataFrame of imported .csv data
Returns:
extraction: Dataframe of only the relevant data
extraction: DataFrame of only the relevant data
"""
extraction = data.iloc[:, 5:8]
extraction = extraction.copy()
@@ -130,8 +130,7 @@ class CSVWriter(FileWriter):
Args:
path: Path to save location
results: Results to write to file
result_type: Type of the results
('mistakes.csv' or delay.csv')
result_type: Type of the results ('mistakes.csv' or delay.csv')
"""
results.sort_values(by=['participant', 'video', 'condition'],
inplace=True)
Loading