|
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 |
|
|
|
|
|
|
|
ihtiyac_data = pd.read_excel("ihtiyac_data.xlsx") |
|
norm_fazlasi = pd.read_excel("norm_fazlasi.xlsx") |
|
|
|
|
|
st.title("Antalya İli Öğretmen İhtiyacı Ve Norm Fazlası Veri Seti Analizi") |
|
|
|
|
|
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 |
|
|
|
|
|
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") |
|
|
|
|
|
st.subheader("Grafik Boyutlandırma") |
|
width = st.slider("Grafik genişliğini ayarlayın (piksel)", 500, 1500, 1500) |
|
height = st.slider("Grafik yüksekliğini ayarlayın (piksel)", 300, 900, 700) |
|
|
|
|
|
st.subheader("İhtiyaç Histogram Grafiği") |
|
|
|
if "ihtiyac" in ihtiyac_data.columns: |
|
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ı.") |
|
|
|
|
|
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) |
|
|
|
|
|
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") |
|
|
|
|
|
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") |
|
|
|
|
|
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") |
|
|
|
|
|
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") |
|
|