Skip to content

Commit 5f170c9

Browse files
committed
Add workaround for converting heights to integers
1 parent b680e0d commit 5f170c9

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

example/modelchain_example.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,9 @@ def get_weather_data(filename='weather.csv', **kwargs):
7979
weather_df.index = pd.to_datetime(weather_df.index).tz_convert(
8080
'Europe/Berlin')
8181
# change type of height from str to int by resetting columns
82-
weather_df.columns = [weather_df.axes[1].levels[0][
83-
weather_df.axes[1].codes[0]],
84-
weather_df.axes[1].levels[1][
85-
weather_df.axes[1].codes[1]].astype(int)]
82+
l0 = [_[0] for _ in weather_df.columns]
83+
l1 = [int(_[1]) for _ in weather_df.columns]
84+
weather_df.columns = [l0, l1]
8685
return weather_df
8786

8887

0 commit comments

Comments
 (0)