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 16 forks source link

to_gdx is changing Text data to Boolean #100

Open jalidrisi opened 11 months ago

jalidrisi commented 11 months ago

I want to write the following data frame to gdx file

R,L R1,L1 R10,L10 R11,L11 R12,L12 R13,L13 R2,L2 R3,L3 R4,L4 R5,L5 R6,L6 R7,L7 R8,L8 R9,L9

but the output I get in the gdx file is like this R9,Y R8,Y R7,Y R6,Y R5,Y R4,Y R3,Y R2,Y R13,Y R12,Y R11,Y R10,Y R1,Y R,Y

how can I keep the same string values from the dataframe ?

elainethale commented 5 months ago

@jalidrisi, I've implemented the ability to preserve Text information when importing GDX information to pandas DataFrame, but not vice-versa. Providing an option to preserve Text data on write should be easy to implement, but I don't have near-term plans to improve gdx-pandas myself.