-
Notifications
You must be signed in to change notification settings - Fork 16
Description
| frame_data = np.array([a for a in data_lists], dtype=np.uint8) |
When decoding, this line can sometimes lead to the following error: "ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. ...”
After looking into it, I believe the problem is, that for some signals not all lists (a) in in the data_list have the same number of columns. Having lines with different column numbers leads to the value error. The assignment "np.array(..)" cannot handle different numbers of columns.
e.g.: For one signal, the first "a" had 63 values, while the next "a" had only 19 values.
I solved it like this:
frame_data = pd.DataFrame([a for a in data_lists]).to_numpy(dtype=np.uint8)
This way, the the "missing columns" are replace with the default value of .to_numpy(dtype=np.uint8), which is "0".
Could you please verify this correction?