Skip to content

Undesireable output of the to_data_frame  #8044

@balandongiv

Description

@balandongiv

Describe the bug

The idea is to produce the output with respect to set time_format parameter under the to_data_frame method. However, setting the time_format to either None, 'timedelta', 'datetime' and 'ms' produce an incremental plus 1 integer instead of the scaled time (e.g., 0, 0.001,0.002) for a signal that sampled in 1000Hz.

Steps to reproduce

  • filename='S17_5.mff' # The mff file is accessible via download link provided below
raw = mne.io.read_raw_egi(filename, preload=True)
print(raw.to_data_frame(picks=['E1']))

Return the following

Reading 0 ... 300936  =      0.000 ...   300.936 secs...
 	time            E1
0            0  15372.021811
1            1  15375.733752
2            2  15371.825459
3            3  15367.826391
4            4  15363.235307

raw = mne.io.read_raw_egi(filename, preload=True)
print(raw.to_data_frame(picks=['E1'],time_format='ms'))

Return the following

          time            E1
0            0  15372.021811
1            1  15375.733752
2            2  15371.825459
3            3  15367.826391
4            4  15363.235307

raw = mne.io.read_raw_egi(filename, preload=True)
print(raw.to_data_frame(picks=['E1'],time_format='timedelta'))

Return the following

                  time            E1
0             00:00:00  15372.021811
1      00:00:00.001000  15375.733752
2      00:00:00.002000  15371.825459
3      00:00:00.003000  15367.826391
4      00:00:00.004000  15363.235307

Expected results

At least, the column time should look

[0. 0.001 0.002 0.003 0.004 0.005 0.006 0.007 0.008 ]

Actual results

Additional information

System:

Windows 10
anaconda3
mne-0.21.dev0
Python 3.7
Link to download S17_5.mff

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions