У меня есть набор данных определенных значений, разделенных на 2008 и 2013 годы. Однако, когда я строю их с помощью matplotlib, на столбчатой диаграмме отображаются только значения 2008 года.
Я хотел бы иметь гистограмму 2008 и 2013 годов для сравнения.

До сих пор мне удавалось только произвести это 
import numpy as np
import matplotlib.pyplot as plt
data = np.genfromtxt('C:\data/IT8701_CA2_Data/hdb-resident-population-by-flat-type.csv',
skip_header=1,
dtype=[('shs_year','U50'),('flat_type','U50'),('resident_population','i8')], delimiter=",",
missing_values=['na','-'],filling_values=[0])`
labels = list(set(data['flat_type']))
labels.sort()
residents = np.arange(0,len(labels))
residents_values = data[['flat_type','resident_population']]
values = residents_values['resident_population']
units_values = {}
for i in labels:
valuesforFY = values[residents_values['flat_type']==i]
print("No.of Residents in Flat_type: " + i + " is {}".format(valuesforFY))
#the line below is critical
units_values[i] = valuesforFY
plt.figure(1, figsize=(8,8))
xdata = list(units_values.keys())
ydata = [i[0] for i in units_values.values()]
barchart = plt.bar(xdata, ydata, color='b')