diff --git a/docs/sphinx/source/whatsnew/v0.12.1.rst b/docs/sphinx/source/whatsnew/v0.12.1.rst index 856e5fa5d7..4ea997afcb 100644 --- a/docs/sphinx/source/whatsnew/v0.12.1.rst +++ b/docs/sphinx/source/whatsnew/v0.12.1.rst @@ -10,7 +10,8 @@ Breaking Changes Bug fixes ~~~~~~~~~ - +* :py:func:`pvlib.iotools.get_pvgis_tmy` now returns the correct dtypes when + when ``outputformat='epw'``. (:issue:`2399`, :pull:`2417`) Enhancements ~~~~~~~~~~~~ diff --git a/pvlib/iotools/pvgis.py b/pvlib/iotools/pvgis.py index 46406c5a53..425cceb84c 100644 --- a/pvlib/iotools/pvgis.py +++ b/pvlib/iotools/pvgis.py @@ -410,6 +410,9 @@ def _coerce_and_roll_tmy(tmy_data, tz, year): np.roll(tmy_data, tz, axis=0), columns=tmy_data.columns, index=new_index) + # GH 2399 + new_tmy_data = \ + new_tmy_data.astype(dtype=dict(zip(tmy_data.columns, tmy_data.dtypes))) return new_tmy_data