File size: 4,977 Bytes
d82822a
 
 
854722b
 
d82822a
854722b
d82822a
 
5d73804
 
d82822a
 
854722b
d82822a
 
 
854722b
 
d82822a
 
 
 
 
fda422f
d82822a
 
 
 
 
fda422f
d82822a
 
 
 
 
854722b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
d82822a
854722b
d82822a
854722b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
d82822a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
854722b
d82822a
 
854722b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
import pandas as pd
import streamlit as st
import matplotlib.pyplot as plt
import plotly.express as px
import plotly.graph_objects as go
import seaborn as sns
      #/Users/donme/Library/Python/3.9/lib/python/site-packages

# Dosyaları yükle
ihtiyac_data = pd.read_excel("ihtiyac_data.xlsx")
norm_fazlasi = pd.read_excel("norm_fazlasi.xlsx")

# Streamlit Başlığı
st.title("Antalya İli Öğretmen İhtiyacı Ve Norm Fazlası Veri Seti Analizi")

# Sekmeler
tab1, tab2, tab3, tab4, tab5 = st.tabs(["Veri Keşfi", "Görselleştirme", "Analiz", "Sıralama", "Raporlama"])
numeric_columns = ihtiyac_data.select_dtypes(include=['float64', 'int64']).columns
#column = st.selectbox("Histogram için bir sütun seçin", numeric_columns)

with tab1:
    st.header("Veri Keşfi")

    st.subheader("İhtiyaç Data")
    st.write(ihtiyac_data)
    st.write("Veri Kümesi Boyutları:", ihtiyac_data.shape)
    st.write("Eksik Değer Sayısı:")
    st.write(ihtiyac_data.isnull().sum())

    st.subheader("Norm Fazlası Data")
    st.write(norm_fazlasi)
    st.write("Veri Kümesi Boyutları:", norm_fazlasi.shape)
    st.write("Eksik Değer Sayısı:")
    st.write(norm_fazlasi.isnull().sum())

with tab2:
    st.header("Grafiksel Analiz")

    # Kullanıcıdan grafik boyutlarını alma
    st.subheader("Grafik Boyutlandırma")
    width = st.slider("Grafik genişliğini ayarlayın (piksel)", 500, 1500, 1500)  # Varsayılan genişlik
    height = st.slider("Grafik yüksekliğini ayarlayın (piksel)", 300, 900, 700)  # Varsayılan yükseklik

    # Histogram (Plotly)
    st.subheader("İhtiyaç Histogram Grafiği")
    
    if "ihtiyac" in ihtiyac_data.columns:  # Sütunun veri setinde mevcut olduğundan emin olun
        fig = px.histogram(
            ihtiyac_data,
            x="ihtiyac",
            marginal="box",
            title="Histogram of İhtiyaç",
            width=width,
            height=height
        )
        fig.update_layout(
            xaxis_title="İhtiyaç",
            yaxis_title="Frequency",
            hovermode="x"
        )
        st.plotly_chart(fig)
    else:
        st.error("Veri setinde 'ihtiyaç' adlı bir sütun bulunamadı.")

    # Bar Grafiği (Plotly)
    st.subheader("Kategoriye Göre İhtiyaç Sayısı Grafiği")
    categorical_columns = ihtiyac_data.select_dtypes(include=['object']).columns
    bar_column = st.selectbox("Bir Kategori Seçin", categorical_columns)
    if bar_column:
        bar_data = ihtiyac_data[bar_column].value_counts().reset_index()
        bar_data.columns = [bar_column, "Count"]
        fig = px.bar(bar_data, x=bar_column, y="Count", title=f"Bar Chart of {bar_column}", width=width, height=height)
        fig.update_layout(xaxis_title=bar_column, yaxis_title="Count", hovermode="x")
        st.plotly_chart(fig)

    # Scatter Plot (Plotly)
    st.subheader("Dağılım Grafiği")
    x_axis = st.selectbox("X Ekseni için bir sütun seçin", ihtiyac_data.columns, key="scatter_x")
    y_axis = st.selectbox("Y Ekseni için bir sütun seçin", ihtiyac_data.columns, key="scatter_y")
    if x_axis and y_axis:
        fig = px.scatter(ihtiyac_data, x=x_axis, y=y_axis, title=f"Scatter Plot of {x_axis} vs {y_axis}", width=width, height=height)
        fig.update_traces(marker=dict(size=10, color='rgba(0,100,200,0.5)', line=dict(width=1, color='DarkSlateGrey')))
        fig.update_layout(xaxis_title=x_axis, yaxis_title=y_axis, hovermode="closest")
        st.plotly_chart(fig)

with tab3:
    st.header("Veri Analizi")

    # Filtreleme
    st.subheader("Filtreleme")
    filter_column = st.selectbox("Filtreleme için bir sütun seçin", numeric_columns)
    if filter_column:
        min_value, max_value = st.slider("Değer Aralığını Seçin", float(ihtiyac_data[filter_column].min()), float(ihtiyac_data[filter_column].max()), (float(ihtiyac_data[filter_column].min()), float(ihtiyac_data[filter_column].max())))
        filtered_data = ihtiyac_data[(ihtiyac_data[filter_column] >= min_value) & (ihtiyac_data[filter_column] <= max_value)]
        st.write(filtered_data)

with tab4:
    st.header("Sıralama")

    # Sütuna göre sıralama
    sort_column = st.selectbox("Sıralamak için bir sütun seçin", numeric_columns)
    ascending = st.radio("Sıralama Türü", ("Artan", "Azalan")) == "Artan"
    if sort_column:
        sorted_data = ihtiyac_data.sort_values(by=sort_column, ascending=ascending)
        st.write(sorted_data)

with tab5:
    st.header("Raporlama")

    # Dinamik rapor oluşturma
    st.subheader("Dinamik Raporlama")
    selected_columns = st.multiselect("Rapor için sütunları seçin", ihtiyac_data.columns)
    if selected_columns:
        st.write(ihtiyac_data[selected_columns])

    

st.sidebar.title("Hakkında")
st.sidebar.info("Bu uygulama,Antalya ili öğretmen ihtiyacı ve norm fazlası veri setleri üzerinden veri analizi,verilerin görselleştirilmesi ve filtrelenmesi gibi işlemlerin yapılabilmesi için tasarlanmıştır")