You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The documentation shows the following usage example for the write functionality:
import c3d
import numpy as np
writer = c3d.Writer()
for _ in range(100):
writer.add_frame(np.random.randn(30, 5))
with open('random-points.c3d', 'wb') as h:
writer.write(h)
This has two issues. First, it should be add_frames but not add_frame. That's easy to fix. But the second issue is hard to fix, since write.write expects a second argument, labels, and it is not clear what it should be
Hi, I have a similar problem with c3d.Writer. Any idea how to fix it?
fori, point, analoginreader.read_frames():
writer.add_frames((point,analog))
Traceback (most recent call last):
File F:\Python310\lib\site-packages\numpy\core\fromnumeric.py:2022 in shape
result = a.shape
AttributeError: 'list' object has no attribute 'shape'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
Cell In[122], line 2
writer.add_frames((point,analog))
File F:\Python310\lib\site-packages\c3d\c3d.py:2213 in add_frames
sh = np.shape(frames)
File F:\Python310\lib\site-packages\numpy\core\fromnumeric.py:2024 in shape
result = asarray(a).shape
ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 2 dimensions. The detected shape was (1, 2) + inhomogeneous part.
Any help is greatly appreciated.
Python 3.10, Numpy 1.25
The documentation shows the following usage example for the
write
functionality:This has two issues. First, it should be
add_frames
but notadd_frame
. That's easy to fix. But the second issue is hard to fix, sincewrite.write
expects a second argument,labels
, and it is not clear what it should beTypeError: write() missing 1 required positional argument: 'labels'
The text was updated successfully, but these errors were encountered: