From d3a52c8bfc82c95515402ce8b3291d9c424fef4e Mon Sep 17 00:00:00 2001 From: Peter Yefi Date: Thu, 28 Apr 2022 10:58:45 -0400 Subject: [PATCH] Fixed pandas append deprecation warning --- imports/energy_systems/water_to_water_hp_parameters.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/imports/energy_systems/water_to_water_hp_parameters.py b/imports/energy_systems/water_to_water_hp_parameters.py index 8df8563f..e1cdaf55 100644 --- a/imports/energy_systems/water_to_water_hp_parameters.py +++ b/imports/energy_systems/water_to_water_hp_parameters.py @@ -79,11 +79,13 @@ class WaterToWaterHPParameters: :param ranges: the range of values to extract :return: List """ - data = df.iloc[ranges[0]:ranges[1], columns[0]].append(df.iloc[ranges[0]:ranges[1], columns[1]])\ - .append(df.iloc[ranges[0]:ranges[1], columns[2]]) + data = pd.concat([df.iloc[ranges[0]:ranges[1], columns[0]], df.iloc[ranges[0]:ranges[1], columns[1]]]) + data = pd.concat([df.iloc[ranges[0]:ranges[1], columns[2]], data]) for i in range(1, 5): - data = data.append(df.iloc[ranges[i]:ranges[i + 1], columns[0]]).append( - df.iloc[ranges[i]:ranges[i + 1], columns[1]]).append(df.iloc[ranges[i]:ranges[i + 1], columns[2]]) + data = pd.concat([df.iloc[ranges[i]:ranges[i + 1], columns[0]], data]) + data = pd.concat([df.iloc[ranges[i]:ranges[i + 1], columns[1]], data]) + data = pd.concat([df.iloc[ranges[i]:ranges[i + 1], columns[2]], data]) + return data.dropna().values.tolist() def _extract_flow_and_ewt(self, df, ranges, columns, flow_rates):