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
Problem processing rows of uneven number of elements #12
Comments
Thank you @nevr1106! Are uneven number of elements supported by LVM? |
The dataset I had problem with is shaped like this:
I do think the added comment is the trigger of the problem. The dataset with empty comment does not produce the same error. |
Ok. Thanks for the explanation. Can you please attach the sample file? |
Here is a dummy dataset that will trigger this error. |
@nevr1106 I have prepared a PR: #13 Please check it out and give feedback. |
Yes, it is masked data from a real testing facility. The uneven data comes from sensors operating at different sampling frequency. |
dear @nevr1106 have you further tested this implementation? It is a relatively big change and I am slightly hesitant in merging it... :) |
I found a problem with the lvm_read.read() function when processing a labview data file. Further testing shows that it cannot process rows of uneven number of elements.
Error prompted:
ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (20224,) + inhomogeneous part.
Source of the problem:
lvm_data[s]['data'] = np.asarray(lvm_data[s]['data'])
if the
lvm_data[s]['data']
is like this:Then it will produce this error.
Solution:
Based on solution proposed here: ayhan, the problem code can be changed to the following:
lvm_data[s]['data'] = np.asarray(list(itertools.zip_longest(*lvm_data[s]['data'], fillvalue=0))).T
The text was updated successfully, but these errors were encountered: