В график включаются лишние элементы

Есть датасет, нужно вывести на графики каждую архитектуру из types по systems:

data = pd.read_csv('ap-northeast-1.csv', parse_dates=['2017-05-08 21:46:36+00:00'], dayfirst=False)
data.columns = ['Date', 'Architecture', 'OS', 'Office', 'price']
types= ['i2.2xlarge', 'i2.4xlarge', 'i2.8xlarge', 'i2.xlarge', 'i3.16xlarge', 'i3.2xlarge', 'i3.4xlarge', 'i3.8xlarge', 'i3.large', 'i3.xlarge']
systems = ['Windows', 'SUSE Linux', 'Linux/UNIX']

Сделал с костылем:

fig, axes = plt.subplots(5, 2, figsize=(20,60))
i = 0
j = 0
for i in range(10):
    d_grouped_by_i = data.groupby('Architecture').get_group(types[i])
    for row in range(5):
        for column in range(2):
            for j in range(3):
                date = d_grouped_by_i.groupby('OS').get_group(systems[j])['Date']
                price = d_grouped_by_i.groupby('OS').get_group(systems[j])['price']
                axes[row, column].plot(date, price, label=types[i]+' for '+systems[j])
                axes[row, column].set_title('Price of '+types[i])
                axes[row, column].set_ylabel('price per hour, $US')
                axes[row, column].grid()
                axes[row, column].legend(loc='upper left', title='Stock prices')
                plt.subplots_adjust(hspace=0.35)
                j+=1
            i += 1    
plt.show()

В результате с первого по девятый графики выводятся 2 архитектуры для каждой OS - на графике 6 полос данных, а нужно 3. На десятом все в порядке. Прошу помощи у многоуважаемых специалистов! Ссылка на csv - ссылка


Ответы (0 шт):