Skip to content

Commit 65e5781

Browse files
committed
Convert strings to integer
1 parent 29167f5 commit 65e5781

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

windpowerlib/modelchain.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
SPDX-License-Identifier: MIT
88
"""
99
import logging
10+
import pandas as pd
1011
from windpowerlib import (wind_speed, density, temperature, power_output,
1112
tools)
1213

@@ -438,6 +439,11 @@ def run_model(self, weather_df):
438439
'wind_speed'
439440
440441
"""
442+
# Convert data heights to integer. In some case they are strings.
443+
weather_df.columns = pd.MultiIndex.from_arrays([
444+
weather_df.columns.get_level_values(0),
445+
weather_df.columns.get_level_values(1).astype(int)])
446+
441447
wind_speed_hub = self.wind_speed_hub(weather_df)
442448
density_hub = (None if (self.power_output_model == 'power_curve' and
443449
self.density_correction is False)

0 commit comments

Comments
 (0)