Skip to content

Commit 3444e07

Browse files
committed
Merge branch 'features/add_warning_if_nan_values_in_weather_data' of github.com:wind-python/windpowerlib into features/add_warning_if_nan_values_in_weather_data
2 parents e98020b + 423d01f commit 3444e07

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

windpowerlib/tools.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -233,14 +233,19 @@ def check_weather_data(weather_df):
233233
234234
"""
235235
# Convert data heights to integer. In some case they are strings.
236-
weather_df.columns = pd.MultiIndex.from_arrays([
237-
weather_df.columns.get_level_values(0),
238-
pd.to_numeric(weather_df.columns.get_level_values(1))])
236+
weather_df.columns = pd.MultiIndex.from_arrays(
237+
[
238+
weather_df.columns.get_level_values(0),
239+
pd.to_numeric(weather_df.columns.get_level_values(1)),
240+
]
241+
)
239242

240243
# check for nan values
241244
if weather_df.isnull().any().any():
242245
nan_columns = list(weather_df.columns[weather_df.isnull().any()])
243-
msg = ("The following columns of the weather data contain invalid "
244-
"values like 'nan': {0}")
246+
msg = (
247+
"The following columns of the weather data contain invalid "
248+
"values like 'nan': {0}"
249+
)
245250
warnings.warn(msg.format(nan_columns), WindpowerlibUserWarning)
246251
return weather_df

0 commit comments

Comments
 (0)