may as well pass through args to read_csv to prevent similar issues
@@ -309,7 +309,7 @@ class BIDSDataFile(BIDSFile):
}
def get_df(self, include_timing=True, adjust_onset=False,
- enforce_dtypes=True):
+ enforce_dtypes=True, **pd_args):
"""Return the contents of a tsv file as a pandas DataFrame.
Parameters
@@ -326,6 +326,8 @@ class BIDSDataFile(BIDSFile):
If True, enforces the data types defined in
the BIDS spec on core columns (e.g., subject_id and session_id
must be represented as strings).
+ pd_args : dict
+ Optional keyword arguments to pass onto pd.read_csv().
Returns
-------
@@ -350,7 +352,7 @@ class BIDSDataFile(BIDSFile):
suffix = self.entities['suffix']
header = None if suffix in {'physio', 'stim'} else 'infer'
self.data = pd.read_csv(self.path, sep='\t', na_values='n/a',
- dtype=dtype, header=header)
+ dtype=dtype, header=header, **pd_args)
data = self.data.copy()
