我正在尝试用Python编写这个参数的数据集。我使用了xarray
,但我无法获得正确的代码...我如何用Python编写这个数据集?
我在下面写了一个参数的集合和数据集。
Sets
i "products" /i1, i2, i3, i4, i5, i6, i7, i8, i9, i10/
j "processing units" /j1, j2, j3/
s "production sites" /s1, s2, s3/;
Table v(i,j,s)
s1 s2 s3
i1.j1 5
i2.j1 5
i3.j1 5
i4.j1 5
i5.j2 6
i6.j2 6
i7.j2 6
i8.j2 6
i9.j3 4
i10.j3 4
;
如何在Python中编写此数据集?
1条答案
按热度按时间isr3a4wc1#
首先,你给出的例子并不容易理解,但是我试着写了一些有用的东西。你可以使用np.meshgrid: