Skip to content

Index problem #196

@jingyuan1994

Description

@jingyuan1994

Python version

3.8.3 (default, May 19 2020, 06:50:17) [MSC v.1916 64 bit (AMD64)]

Platform information

Windows-10-10.0.17134-SP0

Numpy version

1.19.0

mdfreader version

4.1

Description

There is an unusual problem happened. I got 2 MDF files which recorded by DataLogger, one of them could be read well but the other one reported a bug

File "D:/program/12222.py", line 20, in
dt = mdfreader.Mdf('Data2F002Data2F002.mdf')
File "D:\Anaconda\envs\test\Lib\site-packages\mdfreader\mdf.py", line 150, in init
self.read(file_name, channel_list=channel_list,
File "D:\Anaconda\envs\test\Lib\site-packages\mdfreader\mdfreader.py", line 409, in read
self.read3(self.fileName, None, multi_processed, channel_list,
File "D:\Anaconda\envs\test\Lib\site-packages\mdfreader\mdf3reader.py", line 947, in read3
buf.read(channel_set, self.fileName) # reads datablock potentially containing several channel groups
File "D:\Anaconda\envs\test\Lib\site-packages\mdfreader\mdf3reader.py", line 702, in read
data = self.load_unsorted(name_set=channel_set)
File "D:\Anaconda\envs\test\Lib\site-packages\mdfreader\mdf3reader.py", line 773, in load_unsorted
buf[channel_name][index[record_id]] = self.fid.read(nBytes[channel_name])
IndexError: index 18 is out of bounds for axis 0 with size 18

I try to fix it but I got no idea of changing the length of index. Following image is the details of my data. Hope you could help me to fix it. Thanks!

debug

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions