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

Duplicate index fools type inference #62

Closed jebob closed 1 year ago

jebob commented 5 years ago

Minimum example

import gdxpds
import pandas as pd

df1 = pd.DataFrame(
    index=[0, 1, 2],
    data={
        "A": [0, 1, 2],
        "value": [3, 4, 5],
    }
)

df2 = pd.DataFrame(
    index=[0, 0, 0],
    data={
        "A": [0, 1, 2],
        "value": [3, 4, 5],
    }
)

gdxpds.to_gdx({"df1": df1, "df2": df2}, "out.gdx")

Results in

image

image

But since gdxpds doesn't use the index, I would expect them to be the same.