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

ValueError: can not merge DataFrame with instance of type <class 'pandas.core.series.Series'> #45

Closed samRddhimat closed 6 years ago

samRddhimat commented 6 years ago

I'm using Pandas 0.23.4.

When trying merging two columns year and day of a dataframe, both are values of type Series. I go the below error

image

serdar- commented 6 years ago

This is not a question related to gdxpds. Please check the documentation about merging pandas tables here: https://pandas.pydata.org/pandas-docs/stable/generated/pandas.merge.html

merge function takes DataFrames as arguments, not Series.

elainethale commented 6 years ago

Also, you can generally construct a DataFrame from a Series:

df = pds.DataFrame(a_series)