Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用 Pyomo,我想导入两个或多个数据文件(扩展名 .dat)。我该怎么做?
我只知道如何导入其中一个,如下所示:
instance = model.create_instance('datos1.dat')
谢谢,玛丽亚
您需要使用该DataPortal对象。例如,
DataPortal
model = AbstractModel() ... data = DataPortal() data.load(filename="f1.dat", model=model) data.load(filename="f2.dat", model=model) instance = model.create_instance(data)