Skip to content

Setting records of multidimensional Set with empty DataFrame fails #8

@grecht

Description

@grecht

Hi, I have a situation where depending on the input data a multidimensional set might be empty. This would be encoded in the empty records DataFrame, and I want to avoid having to check if it is empty. This seems to work for one dimensional sets, but not for multidimensional sets:

import pandas as pd
import gamspy as gp

ct = gp.Container()

df_a = pd.DataFrame(columns=["a"])
A = ct.addSet("A", records=df_a)  # works

# does not work
B = ct.addSet("B")

df_ab = pd.DataFrame(columns=["a", "b"])
AB = ct.addSet("AB", domain=[A, B], records=df_ab)  # does not work

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions