NREL / gdx-pandas

Python interface to read and write GAMS GDX files using pandas.DataFrames as the intermediate data format.
BSD 3-Clause "New" or "Revised" License
43 stars 15 forks source link

FIX: Check "Value" by position, not by label #89

Closed jebob closed 1 year ago

jebob commented 3 years ago

The problem is this line: if isinstance(df.loc[df.index[0],df.columns[-1]],Number): where we expect a Number (parameter) or a cbool or a str (set), we get an array if df.index[0] matches multiple rows. Switching to locational indexing iloc avoids this problem.

Closes #62

Conflicts with #87, but very easy to fix.

Tests