rk4(pointer->t[i-1], pointer->x[i-1], dt); }# my_python.pyimport numpy然而,我认为x_python = [data.x[i] for x i in range(*number_of_elements*)]是有效的,但如果数组很长,它就会非常慢。此外,如果这不是将数组从C语言传递到Python的最佳方法,那么还有什么其他方法适合这种应用程序呢?例如,对于每个时间步,或者可能在到达某个最终时
我有5000幅图像,numpy中训练数据数组X的形状是(5000,1),数组有dtype对象。这是因为在单个numpy数组中不可能存储不同形状的内容。列表中的每个对象都具有形状(80,lenght_of_image_i,2)。数组转换为numpy数组的Python列表也不起作用:
AttributeError: 'list' object has no attribute