bug fixed in monthly_values.py

This commit is contained in:
Pilar 2021-06-08 12:58:57 -04:00
parent 4b2dfea2a4
commit e064adc29e

View File

@ -6,7 +6,7 @@ Copyright © 2020 Project Author Pilar Monsalvete pilar_monsalvete@yahoo.es
import pandas as pd import pandas as pd
import numpy as np import numpy as np
import helpers.constants as cte import calendar as cal
class MonthlyValues: class MonthlyValues:
@ -40,7 +40,8 @@ class MonthlyValues:
""" """
array = [] array = []
for i in range(0, 12): for i in range(0, 12):
total_hours = cte.days_of_month[i] * 24 days_of_month = cal.monthrange(2015, i+1)[1]
total_hours = days_of_month * 24
array = np.concatenate((array, np.full(total_hours, i + 1))) array = np.concatenate((array, np.full(total_hours, i + 1)))
self._month_hour = pd.DataFrame(array, columns=['month']) self._month_hour = pd.DataFrame(array, columns=['month'])
return self._month_hour return self._month_hour