In [1]:
import pandas as pd
In [2]:
%matplotlib inline
import matplotlib
matplotlib.style.use('ggplot')
In [3]:
podaci=pd.read_excel("MAT1.xls")

Frekvencije

In [4]:
def frekvencije(tablica,varijabla):
    freq=tablica[varijabla].value_counts().sort_index()
    rel_freq=freq/tablica[varijabla].count()
    return pd.DataFrame({"frekvencije":freq,"relativne frekvencije":rel_freq})

Frekvencije prvog kolokvija

In [5]:
frek_KOL1=frekvencije(podaci,"KOL1")

frekvencije

In [6]:
frek_KOL1['frekvencije'].plot(kind='bar',grid=True,colormap='Accent');

relativne frekvencije

In [7]:
frek_KOL1['relativne frekvencije'].plot(kind='bar',grid=True,colormap='Accent');

Frekvencije drugog kolokvija

In [8]:
frek_KOL2=frekvencije(podaci,"KOL2")

frekvencije

In [9]:
frek_KOL2['frekvencije'].plot(kind='bar',grid=True,colormap='Accent');

relativne frekvencije

In [10]:
frek_KOL2['relativne frekvencije'].plot(kind='bar',grid=True,colormap='Accent');

Frekvencije trećeg kolokvija

In [11]:
frek_KOL3=frekvencije(podaci,"KOL3")

frekvencije

In [12]:
frek_KOL3['frekvencije'].plot(kind='bar',grid=True,colormap='Accent');

relativne frekvencije

In [13]:
frek_KOL3['relativne frekvencije'].plot(kind='bar',grid=True,colormap='Accent');

Prolaznost na kontinuiranom praćenju

In [14]:
frek_Ocjena=frekvencije(podaci,"Ocjena")
In [15]:
frek_Ocjena['frekvencije'].plot(kind='bar',grid=True,colormap='Accent');
In [16]:
frek_Ocjena['frekvencije'].plot(kind='pie',grid=True,colormap='Accent',autopct='%.2f',figsize=[6,6]);

Korelacije kolokvija

In [17]:
podaci.plot(kind='scatter', x='KOL1', y='KOL2',grid=True,c="red",s=30);
In [18]:
podaci.plot(kind='scatter', x='KOL1', y='KOL3',grid=True,c="red",s=30);
In [19]:
podaci.plot(kind='scatter', x='KOL2', y='KOL3',grid=True,c="red",s=30);

Korelacije kolokvija i aktivnosti

In [20]:
podaci.plot(kind='scatter', x='KOL1', y='Aktivnost',grid=True,c="red",s=30);
In [21]:
podaci.plot(kind='scatter', x='KOL2', y='Aktivnost',grid=True,c="red",s=30);
In [22]:
podaci.plot(kind='scatter', x='KOL3', y='Aktivnost',grid=True,c="red",s=30);

Korelacije kolokvija i ocjene

In [23]:
podaci.plot(kind='scatter', x='KOL1', y='Ocjena',grid=True,c="red",s=30);
In [24]:
podaci.plot(kind='scatter', x='KOL2', y='Ocjena',grid=True,c="red",s=30);
In [25]:
podaci.plot(kind='scatter', x='KOL3', y='Ocjena',grid=True,c="red",s=30);

Korelacija aktivnosti i ocjene

In [26]:
podaci.plot(kind='scatter', x='Aktivnost', y='Ocjena',grid=True,c="red",s=30);

Tablica korelacija

In [27]:
podaci[["KOL1","KOL2","KOL3","Aktivnost","Ocjena"]].corr(method='pearson')
Out[27]:
KOL1 KOL2 KOL3 Aktivnost Ocjena
KOL1 1.000000 0.631585 0.605342 0.461817 0.757558
KOL2 0.631585 1.000000 0.663200 0.517447 0.762720
KOL3 0.605342 0.663200 1.000000 0.527914 0.822551
Aktivnost 0.461817 0.517447 0.527914 1.000000 0.695853
Ocjena 0.757558 0.762720 0.822551 0.695853 1.000000
In [ ]: