Currently, pandas.Datetime will get converted to a string, and pandas.Timedelta causes segfaults (in some cases at least). This emerged when testing MNE-R compatibility with mne-tools/mne-python#7206, which overhauls the to_data_frame instance methods of MNE-Python. Sample R code to replicate the segfault:
library(reticulate)
use_condaenv('mnedev', conda='/opt/miniconda3/condabin/conda') # edit path as needed
library(mne)
data_path <- mne$datasets$sample$data_path()
raw_fname <- paste(data_path, 'MEG', 'sample',
'sample_audvis_filt-0-40_raw.fif', sep = '/')
raw <- mne$io$read_raw_fif(raw_fname)$crop(tmax=10)
foo <- raw$to_data_frame() # works
foo <- raw$to_data_frame(time_format=NULL) # works
foo <- raw$to_data_frame(time_format='datetime') # works, but time column is strings
foo <- raw$to_data_frame(time_format='timedelta') # segfault: memory not mapped
Currently,
pandas.Datetimewill get converted to a string, andpandas.Timedeltacauses segfaults (in some cases at least). This emerged when testing MNE-R compatibility with mne-tools/mne-python#7206, which overhauls theto_data_frameinstance methods of MNE-Python. Sample R code to replicate the segfault: