replace pd deprecated append with concat

This commit is contained in:
simon 2022-02-21 16:55:14 +07:00
parent 2d18fdd97f
commit c71424e296
Signed by: simon
GPG Key ID: 2C15AA5E89985DD4
2 changed files with 4 additions and 4 deletions

View File

@ -168,7 +168,7 @@ class MonthGenerator():
file_name = 'static/dyn/monthly/' + date_file + '.png'
print(f'exporting graph for {date_title}')
# build ticks
y_max = np.ceil(max(y_1.append(y_2)) / 50) * 50 + 50
y_max = np.ceil(max(pd.concat([y_1, y_2])) / 50) * 50 + 50
x_range = np.arange(0, len(x), step=9)
last_day = int(x.max().split()[0])
x_numbers = np.arange(1, last_day + 1, step=3)

View File

@ -154,7 +154,7 @@ class LastSevenDays:
y_1 = self.axis['y_1'].replace(0, 1)
y_2 = self.axis['y_2'].replace(0, 1)
x_ticks = self.axis['x_ticks']
y_max = np.ceil(max(y_1.append(y_2))/50)*50 + 50
y_max = np.ceil(max(pd.concat([y_1, y_2]))/50)*50 + 50
# plot
plt.style.use('seaborn')
plt.plot(x, y_1, color='#313131', label='2hour avg')
@ -279,7 +279,7 @@ class PmGraphs:
}
# max
self.y_max = np.ceil(
max(axis['y_pm25'].append(axis['y_pm10'])) / 25
max(pd.concat([axis['y_pm25'], axis['y_pm10']])) / 25
) * 25 + 25
return axis
@ -465,7 +465,7 @@ class YearComparison:
col_y_1 = NightlyPlots.color_colums(y_1)
col_y_2 = NightlyPlots.color_colums(y_2)
# set ticks
y_max = int(np.ceil((max(y_1.append(y_2)) / 50)) * 50 + 50)
y_max = int(np.ceil((max(pd.concat([y_1, y_2])) / 50)) * 50 + 50)
x_indexes = np.arange(len(x))
# build plot
width = 0.25