def average_and_std_laun(): pass test = dict() for row in data.vinna: if row['Kyn'] == 'Alls' and row['Starfsstétt'] == 'Alls': test[row['Ár']] = row[ 'Heildarlaun - fullvinnandi Efri fjórðungsmörk'], row[ 'Heildarlaun - fullvinnandi Neðri fjórðungsmörk'] q1 = list() q3 = list() test = ds.key_sort(test) for q, (w, e) in test: q1.append(e) q3.append(w) q1 = i.toint(q1) q3 = i.toint(q3) q1.sort() q3.sort() # just cuz I caann listq1 = numpy.array(q1) stdevq1 = listq1.std() listq3 = numpy.array(q3) stdevq3 = listq3.std() avnedri = numpy.mean(q1) avefri = numpy.mean(q3) prosq1 = stdevq1 / avnedri prosq3 = stdevq3 / avefri prosfact = avefri / avnedri prosstd = stdevq3 / stdevq1 plot1 = [prosq1, prosq3] plot2 = [prosfact, prosstd] x = [1, 2] label = ["Neðri fjórðungsmörk", "Efri fjórðungsmörk"] label1 = ['Hlutfall milli meðaltals', 'Hlutfall milli Staðalfráviks'] mp.figure(8) mp.subplot(2, 1, 2) mp.bar(x, plot1, align='center') mp.title('Prósentutala Staðalfráviks á meðaltali ') mp.xlim(0, 3) mp.xticks(x, label) mp.subplot(2, 1, 1) mp.bar(x, plot2, align='center') mp.title('Samanburður á meðaltali og Staðalfráviki') mp.xticks(x, label1) mp.xlim(0, 3)
def aldurshop_mentun(): # define parameters Mentun_ar = ('20 til 24 ára', '25 til 29 ára', '30 til 49 ára', '50 til 64 ára', '65 til 74 ára') menntun_kyn = ('Karlar', 'Konur') AllsMentun = {} # pick data and plot multiple plots on multiple figures for menntun in range(len(menntun_menntun)): for kyn in range(len(menntun_kyn)): for ar in range(len(Mentun_ar)): for row in data.menntun: if row['Kyn'] == menntun_kyn[kyn] and row[ 'Menntun'] == menntun_menntun[menntun]: if row['Aldursflokkur/Búseta'] == Mentun_ar[ar]: #removing unwanted parameters and leaving only ejeccational level row = dict_sort.key_sort(row) row = lti.tuple2_toint(row) AllsMentun[ar] = row AllsMentun[Mentun_ar[ar]] = AllsMentun.pop(ar) # creating 2 dimenational parameters for x and y axis for each age group # x-year, y-amount x = np.zeros((len(Mentun_ar), len(AllsMentun[Mentun_ar[0]]))) y = x.copy() # copying parameters for x and y axis for i in range(len(Mentun_ar)): for j in range(len(AllsMentun[(Mentun_ar[i])])): x[i][j] = AllsMentun[Mentun_ar[i]][j][0] y[i][j] = AllsMentun[Mentun_ar[i]][j][1] # download parameters for plloting grpahs for i in range(len(Mentun_ar)): plt.figure(menntun) plt.subplot(2, 1, kyn + 1) plt.plot(x[i], y[i]) plt.title('Aldursflokkar ({})/ menntun: {}'.format( menntun_kyn[kyn], menntun_menntun[menntun])) plt.xlabel('Ár') plt.ylabel('Mannafjöldi') plt.legend((Mentun_ar), loc='upper right') plt.xlim(np.amin(x) - 2, np.amax(x) + 2) plt.ylim(np.amin(y) - 1000, np.amax(y) + 1000) plt.grid(True) plt.tight_layout()
def aldurshop_mentun(): # define parameters Mentun_ar = ('20 til 24 ára','25 til 29 ára','30 til 49 ára','50 til 64 ára','65 til 74 ára') menntun_kyn = ('Karlar','Konur') AllsMentun = {} # pick data and plot multiple plots on multiple figures for menntun in range (len(menntun_menntun)): for kyn in range(len(menntun_kyn)): for ar in range (len(Mentun_ar)): for row in data.menntun: if row['Kyn'] == menntun_kyn[kyn] and row['Menntun'] == menntun_menntun[menntun]: if row['Aldursflokkur/Búseta'] == Mentun_ar[ar]: #removing unwanted parameters and leaving only ejeccational level row = dict_sort.key_sort(row) row = lti.tuple2_toint(row) AllsMentun[ar] = row AllsMentun[Mentun_ar[ar]] = AllsMentun.pop(ar) # creating 2 dimenational parameters for x and y axis for each age group # x-year, y-amount x = np.zeros((len(Mentun_ar),len(AllsMentun[Mentun_ar[0]]))) y = x.copy() # copying parameters for x and y axis for i in range(len(Mentun_ar)): for j in range(len(AllsMentun[(Mentun_ar[i])])): x[i][j] = AllsMentun[Mentun_ar[i]][j][0] y[i][j] = AllsMentun[Mentun_ar[i]][j][1] # download parameters for plloting grpahs for i in range(len(Mentun_ar)): plt.figure(menntun) plt.subplot(2,1,kyn+1) plt.plot(x[i],y[i]) plt.title('Aldursflokkar ({})/ menntun: {}'.format(menntun_kyn[kyn],menntun_menntun[menntun])) plt.xlabel('Ár') plt.ylabel('Mannafjöldi') plt.legend((Mentun_ar),loc='upper right') plt.xlim(np.amin(x)-2, np.amax(x)+2) plt.ylim(np.amin(y)-1000,np.amax(y)+1000) plt.grid(True) plt.tight_layout()
def GreiddarStundir_FullvinnandiMedaltal(): #---------------------------bý til dict------------------------ #Allir = dict() KK = dict() KVK = dict() #SkrifstofaAllir = dict() SkrifstofaKK = dict() SkrifstofaKVK = dict() #SerfrAllir = dict() SerfrKK = dict() SerfrKVK = dict() #StjoAllir = dict() StjoKK = dict() StjoKVK = dict() #-------------------------------------Filter gögnin ------------------------------------- for row in data.vinna: if row['Starfsstétt'] == 'Alls': #if row['Kyn'] == 'Alls': #Allir[row['Ár']] = row['Greiddar stundir - fullvinnandi Meðaltal'] if row['Kyn'] == 'Karlar': KK[row['Ár']] = row['Greiddar stundir - fullvinnandi Meðaltal'] elif row['Kyn'] == 'Konur': KVK[row['Ár']] = row['Greiddar stundir - fullvinnandi Meðaltal'] elif row['Starfsstétt'] == 'Skrifstofufólk': #if row['Kyn'] == 'Alls': #SkrifstofaAllir[row['Ár']] = row['Greiddar stundir - fullvinnandi Meðaltal'] if row['Kyn'] == 'Karlar': SkrifstofaKK[row['Ár']] = row['Greiddar stundir - fullvinnandi Meðaltal'] elif row['Kyn'] == 'Konur': SkrifstofaKVK[row['Ár']] = row['Greiddar stundir - fullvinnandi Meðaltal'] elif row['Starfsstétt'] == 'Sérfræðingar': #if row['Kyn'] == 'Alls': #SerfrAllir[row['Ár']] = row['Greiddar stundir - fullvinnandi Meðaltal'] if row['Kyn'] == 'Karlar': SerfrKK[row['Ár']] = row['Greiddar stundir - fullvinnandi Meðaltal'] elif row['Kyn'] == 'Konur': SerfrKVK[row['Ár']] = row['Greiddar stundir - fullvinnandi Meðaltal'] elif row['Starfsstétt'] == 'Stjórnendur': #if row['Kyn'] == 'Alls': #StjoAllir[row['Ár']] = row['Greiddar stundir - fullvinnandi Meðaltal'] if row['Kyn'] == 'Karlar': StjoKK[row['Ár']] = row['Greiddar stundir - fullvinnandi Meðaltal'] elif row['Kyn'] == 'Konur': StjoKVK[row['Ár']] = row['Greiddar stundir - fullvinnandi Meðaltal'] #--------------------------------Sorta dict og bý til lista--------------------------------------- #print('Allir: ', StjoAllir) print('KK: ', StjoKK) print('KVK: ', StjoKVK) #Allir = ds.key_sort(Allir) KK = ds.key_sort(KK) KVK = ds.key_sort(KVK) #SkrifstofaAllir = ds.key_sort(SkrifstofaAllir) SkrifstofaKK = ds.key_sort(SkrifstofaKK) SkrifstofaKVK = ds.key_sort(SkrifstofaKVK) #SerfrAllir = ds.key_sort(SerfrAllir) SerfrKK = ds.key_sort(SerfrKK) SerfrKVK = ds.key_sort(SerfrKVK) #StjoAllir = ds.key_sort(StjoAllir) StjoKK = ds.key_sort(StjoKK) StjoKVK = ds.key_sort(StjoKVK) #----------------------------------Breyti listanum í float------------------------------------------- #Allir = fl.tuple2_tofloat(Allir) KK = fl.tuple2_tofloat(KK) KVK = fl.tuple2_tofloat(KVK) #SkrifstofaAllir = fl.tuple2_tofloat(SkrifstofaAllir) SkrifstofaKK = fl.tuple2_tofloat(SkrifstofaKK) SkrifstofaKVK = fl.tuple2_tofloat(SkrifstofaKVK) #SerfrAllir = fl.tuple2_tofloat(SerfrAllir) SerfrKK = fl.tuple2_tofloat(SerfrKK) SerfrKVK = fl.tuple2_tofloat(SerfrKVK) #StjoAllir = fl.tuple2_tofloat(StjoAllir) StjoKK = fl.tuple2_tofloat(StjoKK) StjoKVK = fl.tuple2_tofloat(StjoKVK) #---------------------------------------Bý til lista ------------------------------------ # Allir #xA = list() #yA = list() xK = list() yK = list() xKV = list() yKV = list() # Skrifstofa #xSKA = list() #ySKA = list() xSKK = list() ySKK = list() xSKV = list() ySKV = list() #Sérfræðingar #xSerKA = list() #ySerKA = list() xSerKK = list() ySerKK = list() xSerKV = list() ySerKV = list() # Stjórnendur #xStjoA = list() #yStjoA = list() xStjoKK = list() yStjoKK = list() xStjoKV = list() yStjoKV = list() #-------------------------------------------Skipti gögnunum í tvennt---------------------------------- # for i in range(len(Allir)): # xA.append(Allir[i][0]) # yA.append(Allir[i][1]) for i in range(len(KK)): xK.append(KK[i][0]) yK.append(KK[i][1]) for i in range(len(KVK)): xKV.append(KVK[i][0]) yKV.append(KVK[i][1]) #--------------------------- # for i in range(len(SkrifstofaAllir)): # xSKA.append(SkrifstofaAllir[i][0]) # ySKA.append(SkrifstofaAllir[i][1]) for i in range(len(SkrifstofaKK)): xSKK.append(SkrifstofaKK[i][0]) ySKK.append(SkrifstofaKK[i][1]) for i in range(len(KVK)): xSKV.append(SkrifstofaKVK[i][0]) ySKV.append(SkrifstofaKVK[i][1]) #--------------------------- # for i in range(len(SerfrAllir)): # xSerKA.append(SkrifstofaAllir[i][0]) # ySerKA.append(SkrifstofaAllir[i][1]) for i in range(len(SerfrKK)): xSerKK.append(SerfrKK[i][0]) ySerKK.append(SerfrKK[i][1]) for i in range(len(SerfrKVK)): xSerKV.append(SerfrKVK[i][0]) ySerKV.append(SerfrKVK[i][1]) #--------------------------- # for i in range(len(StjoAllir)): # xStjoA.append(Allir[i][0]) # yStjoA.append(Allir[i][1]) for i in range(len(StjoKK)): xStjoKK.append(StjoKK[i][0]) yStjoKK.append(StjoKK[i][1]) for i in range(len(StjoKVK)): xStjoKV.append(StjoKVK[i][0]) yStjoKV.append(StjoKVK[i][1]) #----------------------------------------------------------------------------- plt.figure(10) plt.subplot(2, 1, 1) plt.xticks([year for year in xK]) plt.plot(xK,yK) plt.plot(xKV,yKV) plt.ylabel('Klukkutímar') plt.title('Greiddar stundir fyrir fullla vinnu - Starfstétt- Allar') plt.legend(('Karlar','Konur')) plt.subplot(2,1,2) plt.xticks([year for year in xSKK]) plt.plot(xSKK,ySKK) plt.plot(xSKV,ySKV) plt.ylabel('Klukkutímar') plt.title('Greiddar stundir fyrir fullla vinnu - Starfstétt- Skrifstofa') plt.legend(('Karlar','Konur')) plt.figure(11) plt.subplot(2,1,1) plt.xticks([year for year in xSerKK]) plt.plot(xSerKK,ySerKK) plt.plot(xSerKV,ySerKV) plt.ylabel('Klukkutímar') plt.title('Greiddar stundir fyrir fullla vinnu - Starfstétt- Sérfræðingar') plt.legend(('Karlar','Konur')) plt.subplot(2,1,2) plt.xticks([year for year in xStjoKK]) plt.plot(xStjoKK,yStjoKK) plt.plot(xStjoKV,yStjoKV) plt.ylabel('Klukkutímar') plt.title('Greiddar stundir fyrir fullla vinnu - Starfstétt- Stjórnendur') plt.legend(('Karlar','Konur')) plt.show() print() print() data.print_keys()
def innanh_vs_utanh(): # svo hægt sé að vitna í þetta í öðrum skrám pass lol = ['Konur','Karlar'] # hvaða breytur á að skoða for illad in range(2): test = dict() input1 = lol[illad] for row in data.menntun: if row['Kyn'] == input1 and row['Aldursflokkur/Búseta'] == 'Höfuðborgarsvæði 16-74 ára': # hvaða breytur á að skoða við hvaða tilefni if row['Menntun'] == 'Háskólamenntun - ISCED 5, 6': test = row # skrifað inn í tímabundna skrá test test = ds.key_sort(test) # sorterað test = test[:-3] # teknir þeir dálkar af gögnunum sem ekki skipta máli hello = i.tuple2_toint(test) # gögnum breytt í tölur af gerð int for row in data.menntun: if row['Kyn'] == input1 and row['Aldursflokkur/Búseta'] == 'Höfuðborgarsvæði 16-74 ára': if row['Menntun'] == 'Alls': test = row test = ds.key_sort(test) test = test[:-3] hello1 = i.tuple2_toint(test) for row in data.menntun: if row['Kyn'] == input1 and row['Aldursflokkur/Búseta'] == 'Utan höfuðborgarsvæðis 16-74 ára': if row['Menntun'] == 'Háskólamenntun - ISCED 5, 6': test = row test = ds.key_sort(test) test = test[:-3] hello2 = i.tuple2_toint(test) for row in data.menntun: if row['Kyn'] == input1 and row['Aldursflokkur/Búseta'] == 'Utan höfuðborgarsvæðis 16-74 ára': if row['Menntun'] == 'Alls': test = row test = ds.key_sort(test) test = test[:-3] hello3 = i.tuple2_toint(test) # viss gögn vinsuð úr inní eftirfarandi breytur x = list() has = list() allir = list() hasland = list() allirland = list() for key, value in hello: x.append(key) has.append(value) for key, value in hello1: allir.append(value) for key, value in hello2: hasland.append(value) for key, value in hello3: allirland.append(value) avhas = numpy.mean(has)# meðaltal fundið avall = numpy.mean(allir) avhasland = numpy.mean(hasland) avallirland = numpy.mean(allirland) plot1 = avhas/avall # Hlutfall fundið plot2 = avhasland/avallirland plot = [plot1,plot2] xas = [1,2] label = ["Innan höfuðborgarsvæðisins","Utan höfuðborgarsvæðisins"] title = [' Prósentumunur á konum sem fá sé Háskólamenntun innan og utan höfuðborgarsvæðis',' Prósentumunur á körlum sem fá sé Háskólamenntun innan og utan höfuðborgarsvæðis'] mp.figure(illad+6) # gögn plottuð upp sem bar graf, mynd 6 út af main skrá mp.bar(xas, plot, align = 'center') mp.title(title[illad]) mp.xticks(xas, label) mp.xlim(0,3) # x ás cappaður í 0-3
Konur = dict(); Karlar = dict() #Breytur sem fara inn í plot Ment = 'Háskólamenntun - ISCED 5, 6' Ald = '16 til 74 ára' for row in data.menntun: if row['Menntun'] == Ment and row ['Aldursflokkur/Búseta'] == Ald and row['Kyn'] == 'Karlar': Karlar = row for row in data.menntun: if row['Menntun'] == Ment and row ['Aldursflokkur/Búseta'] == Ald and row['Kyn'] == 'Konur': Konur = row # Flokka dictionary eftir lyklum Karlar = dict_sort.key_sort(Karlar) Konur = dict_sort.key_sort(Konur) # Breyta tuple í int Karlar = lti.tuple2_toint(Karlar) Konur = lti.tuple2_toint(Konur) ArKK = list(); FjKK = list(); ArKvK = list(); FjKvK = list(); Fj = list() # Setja int í lista for x,y in Karlar: ArKK.append(x) FjKK.append(y) for z,k in Konur: ArKvK.append(z)
def GreiddarStundir_FullvinnandiMedaltal(): #---------------------------bý til dict------------------------ #Allir = dict() KK = dict() KVK = dict() #SkrifstofaAllir = dict() SkrifstofaKK = dict() SkrifstofaKVK = dict() #SerfrAllir = dict() SerfrKK = dict() SerfrKVK = dict() #StjoAllir = dict() StjoKK = dict() StjoKVK = dict() #-------------------------------------Filter gögnin ------------------------------------- for row in data.vinna: if row['Starfsstétt'] == 'Alls': #if row['Kyn'] == 'Alls': #Allir[row['Ár']] = row['Greiddar stundir - fullvinnandi Meðaltal'] if row['Kyn'] == 'Karlar': KK[row['Ár']] = row['Greiddar stundir - fullvinnandi Meðaltal'] elif row['Kyn'] == 'Konur': KVK[row['Ár']] = row[ 'Greiddar stundir - fullvinnandi Meðaltal'] elif row['Starfsstétt'] == 'Skrifstofufólk': #if row['Kyn'] == 'Alls': #SkrifstofaAllir[row['Ár']] = row['Greiddar stundir - fullvinnandi Meðaltal'] if row['Kyn'] == 'Karlar': SkrifstofaKK[row['Ár']] = row[ 'Greiddar stundir - fullvinnandi Meðaltal'] elif row['Kyn'] == 'Konur': SkrifstofaKVK[row['Ár']] = row[ 'Greiddar stundir - fullvinnandi Meðaltal'] elif row['Starfsstétt'] == 'Sérfræðingar': #if row['Kyn'] == 'Alls': #SerfrAllir[row['Ár']] = row['Greiddar stundir - fullvinnandi Meðaltal'] if row['Kyn'] == 'Karlar': SerfrKK[row['Ár']] = row[ 'Greiddar stundir - fullvinnandi Meðaltal'] elif row['Kyn'] == 'Konur': SerfrKVK[row['Ár']] = row[ 'Greiddar stundir - fullvinnandi Meðaltal'] elif row['Starfsstétt'] == 'Stjórnendur': #if row['Kyn'] == 'Alls': #StjoAllir[row['Ár']] = row['Greiddar stundir - fullvinnandi Meðaltal'] if row['Kyn'] == 'Karlar': StjoKK[row['Ár']] = row[ 'Greiddar stundir - fullvinnandi Meðaltal'] elif row['Kyn'] == 'Konur': StjoKVK[row['Ár']] = row[ 'Greiddar stundir - fullvinnandi Meðaltal'] #--------------------------------Sorta dict og bý til lista--------------------------------------- #print('Allir: ', StjoAllir) print('KK: ', StjoKK) print('KVK: ', StjoKVK) #Allir = ds.key_sort(Allir) KK = ds.key_sort(KK) KVK = ds.key_sort(KVK) #SkrifstofaAllir = ds.key_sort(SkrifstofaAllir) SkrifstofaKK = ds.key_sort(SkrifstofaKK) SkrifstofaKVK = ds.key_sort(SkrifstofaKVK) #SerfrAllir = ds.key_sort(SerfrAllir) SerfrKK = ds.key_sort(SerfrKK) SerfrKVK = ds.key_sort(SerfrKVK) #StjoAllir = ds.key_sort(StjoAllir) StjoKK = ds.key_sort(StjoKK) StjoKVK = ds.key_sort(StjoKVK) #----------------------------------Breyti listanum í float------------------------------------------- #Allir = fl.tuple2_tofloat(Allir) KK = fl.tuple2_tofloat(KK) KVK = fl.tuple2_tofloat(KVK) #SkrifstofaAllir = fl.tuple2_tofloat(SkrifstofaAllir) SkrifstofaKK = fl.tuple2_tofloat(SkrifstofaKK) SkrifstofaKVK = fl.tuple2_tofloat(SkrifstofaKVK) #SerfrAllir = fl.tuple2_tofloat(SerfrAllir) SerfrKK = fl.tuple2_tofloat(SerfrKK) SerfrKVK = fl.tuple2_tofloat(SerfrKVK) #StjoAllir = fl.tuple2_tofloat(StjoAllir) StjoKK = fl.tuple2_tofloat(StjoKK) StjoKVK = fl.tuple2_tofloat(StjoKVK) #---------------------------------------Bý til lista ------------------------------------ # Allir #xA = list() #yA = list() xK = list() yK = list() xKV = list() yKV = list() # Skrifstofa #xSKA = list() #ySKA = list() xSKK = list() ySKK = list() xSKV = list() ySKV = list() #Sérfræðingar #xSerKA = list() #ySerKA = list() xSerKK = list() ySerKK = list() xSerKV = list() ySerKV = list() # Stjórnendur #xStjoA = list() #yStjoA = list() xStjoKK = list() yStjoKK = list() xStjoKV = list() yStjoKV = list() #-------------------------------------------Skipti gögnunum í tvennt---------------------------------- # for i in range(len(Allir)): # xA.append(Allir[i][0]) # yA.append(Allir[i][1]) for i in range(len(KK)): xK.append(KK[i][0]) yK.append(KK[i][1]) for i in range(len(KVK)): xKV.append(KVK[i][0]) yKV.append(KVK[i][1]) #--------------------------- # for i in range(len(SkrifstofaAllir)): # xSKA.append(SkrifstofaAllir[i][0]) # ySKA.append(SkrifstofaAllir[i][1]) for i in range(len(SkrifstofaKK)): xSKK.append(SkrifstofaKK[i][0]) ySKK.append(SkrifstofaKK[i][1]) for i in range(len(KVK)): xSKV.append(SkrifstofaKVK[i][0]) ySKV.append(SkrifstofaKVK[i][1]) #--------------------------- # for i in range(len(SerfrAllir)): # xSerKA.append(SkrifstofaAllir[i][0]) # ySerKA.append(SkrifstofaAllir[i][1]) for i in range(len(SerfrKK)): xSerKK.append(SerfrKK[i][0]) ySerKK.append(SerfrKK[i][1]) for i in range(len(SerfrKVK)): xSerKV.append(SerfrKVK[i][0]) ySerKV.append(SerfrKVK[i][1]) #--------------------------- # for i in range(len(StjoAllir)): # xStjoA.append(Allir[i][0]) # yStjoA.append(Allir[i][1]) for i in range(len(StjoKK)): xStjoKK.append(StjoKK[i][0]) yStjoKK.append(StjoKK[i][1]) for i in range(len(StjoKVK)): xStjoKV.append(StjoKVK[i][0]) yStjoKV.append(StjoKVK[i][1]) #----------------------------------------------------------------------------- plt.figure(10) plt.subplot(2, 1, 1) plt.xticks([year for year in xK]) plt.plot(xK, yK) plt.plot(xKV, yKV) plt.ylabel('Klukkutímar') plt.title('Greiddar stundir fyrir fullla vinnu - Starfstétt- Allar') plt.legend(('Karlar', 'Konur')) plt.subplot(2, 1, 2) plt.xticks([year for year in xSKK]) plt.plot(xSKK, ySKK) plt.plot(xSKV, ySKV) plt.ylabel('Klukkutímar') plt.title('Greiddar stundir fyrir fullla vinnu - Starfstétt- Skrifstofa') plt.legend(('Karlar', 'Konur')) plt.figure(11) plt.subplot(2, 1, 1) plt.xticks([year for year in xSerKK]) plt.plot(xSerKK, ySerKK) plt.plot(xSerKV, ySerKV) plt.ylabel('Klukkutímar') plt.title('Greiddar stundir fyrir fullla vinnu - Starfstétt- Sérfræðingar') plt.legend(('Karlar', 'Konur')) plt.subplot(2, 1, 2) plt.xticks([year for year in xStjoKK]) plt.plot(xStjoKK, yStjoKK) plt.plot(xStjoKV, yStjoKV) plt.ylabel('Klukkutímar') plt.title('Greiddar stundir fyrir fullla vinnu - Starfstétt- Stjórnendur') plt.legend(('Karlar', 'Konur')) plt.show() print() print() data.print_keys()
if row['Kyn'] == 'Alls': verka_all[row['Ár']] = row['Heildarlaun - fullvinnandi Meðaltal'] elif row['Kyn'] == 'Karlar': verka_kk[row['Ár']] = row['Heildarlaun - fullvinnandi Meðaltal'] elif row['Kyn'] == 'Konur': verka_kvk[row['Ár']] = row['Heildarlaun - fullvinnandi Meðaltal'] elif row['Starfsstétt'] == 'Þjónustu-, sölu- og afgreiðslufólk': if row['Kyn'] == 'Alls': solu_all[row['Ár']] = row['Heildarlaun - fullvinnandi Meðaltal'] elif row['Kyn'] == 'Karlar': solu_kk[row['Ár']] = row['Heildarlaun - fullvinnandi Meðaltal'] elif row['Kyn'] == 'Konur': solu_kvk[row['Ár']] = row['Heildarlaun - fullvinnandi Meðaltal'] ############################## Sort dictionaries and get lists ################################### avg_all = dict_sort.key_sort(avg_all) avg_kk = dict_sort.key_sort(avg_kk) avg_kvk = dict_sort.key_sort(avg_kvk) avg2_all = dict_sort.key_sort(avg2_all) avg2_kk = dict_sort.key_sort(avg2_kk) avg2_kvk = dict_sort.key_sort(avg2_kvk) stjorn_all = dict_sort.key_sort(stjorn_all) stjorn_kk = dict_sort.key_sort(stjorn_kk) stjorn_kvk = dict_sort.key_sort(stjorn_kvk) serfr_all = dict_sort.key_sort(serfr_all) serfr_kk = dict_sort.key_sort(serfr_kk) serfr_kvk = dict_sort.key_sort(serfr_kvk) idnad_all = dict_sort.key_sort(idnad_all) idnad_kk = dict_sort.key_sort(idnad_kk) idnad_kvk = dict_sort.key_sort(idnad_kvk) skrifst_all = dict_sort.key_sort(skrifst_all)