我想向 python numpy 数组添加描述。
例如,当使用 numpy 作为交互式数据语言时,我想做类似的事情:
A = np.array([[1,2,3],[4,5,6]])
A.description = "Holds all the data from experiment 1. Each row contains an intensity measurement with the following columns: time [s], intensity [W/m^2], error [%]."
但它给出了:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'numpy.ndarray' object has no attribute 'description'
如果不继承 numpy.ndarray 类,这可能吗?
问候,乔纳斯