Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: 'list' object has no attribute 'dtype' #197

Open
tui-abdul opened this issue May 30, 2021 · 2 comments
Open

AttributeError: 'list' object has no attribute 'dtype' #197

tui-abdul opened this issue May 30, 2021 · 2 comments

Comments

@tui-abdul
Copy link

Python version

3.6.9

Platform information

Linux-5.4.0-72-generic-x86_64-with-Ubuntu-18.04-bionic

Numpy version

1.19.5

mdfreader version

4.1

Description

import mdfreader
yop = mdfreader.Mdf('x12.mf4')

x12.mf4 is a file created by IMC Famos, it is a 2-D Matrix with "Structure" property of segments.
Capture
Capture1

Detailed Error

Traceback (most recent call last):
File "mdf_read_test.py", line 13, in
yop = mdfreader.Mdf('x12.mf4')
File "/home/abdul/.local/lib/python3.6/site-packages/mdfreader/mdf.py", line 155, in init
metadata=metadata)
File "/home/abdul/.local/lib/python3.6/site-packages/mdfreader/mdfreader.py", line 420, in read
convert_after_read, filter_channel_names, compression, metadata)
File "/home/abdul/.local/lib/python3.6/site-packages/mdfreader/mdf4reader.py", line 1406, in read4
buf.read(channel_set, info, self.fileName)
File "/home/abdul/.local/lib/python3.6/site-packages/mdfreader/mdf4reader.py", line 374, in read
sorted_flag=True)
File "/home/abdul/.local/lib/python3.6/site-packages/mdfreader/mdf4reader.py", line 478, in load
name_list, sorted_flag, vlsd)
File "/home/abdul/.local/lib/python3.6/site-packages/mdfreader/mdf4reader.py", line 569, in read_data_list
data = recarray(record.numberOfRecords, dtype=tmp.dtype)
AttributeError: 'list' object has no attribute 'dtype'

@ratal
Copy link
Owner

ratal commented Jun 1, 2021

Hi,
You seem to be using a special structure, probably never encountered or thought of.
Channel Array block or compositions applications can be complicated.
But just the traceback is not enough for me to troublehsoot. If you can send the file would be perfect or a snapshot of this composition from MDFValidator to understand this structure (Famos is not so helping) You could also scramble/anonymize the file using asammdf if you have confidentiality issues.

@vicky157
Copy link

data = np.array(data, dtype=np.float32)
use this on ur dataset

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants