RIZAEFE commited on
Commit
d82822a
·
verified ·
1 Parent(s): b0e7bab

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +103 -0
app.py ADDED
@@ -0,0 +1,103 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ import pandas as pd
3
+ import streamlit as st
4
+ import matplotlib.pyplot as plt
5
+ import seaborn as sns
6
+
7
+ # Dosyaları yükle
8
+ ihtiyac_data = pd.read_excel("/mnt/data/ihtiyac_data.xlsx")
9
+ norm_fazlasi = pd.read_excel("/mnt/data/norm_fazlasi.xlsx")
10
+
11
+ # Streamlit Başlığı
12
+ st.title("Veri Analizi ve Görselleştirme Uygulaması")
13
+
14
+ # Sekmeler
15
+ tab1, tab2, tab3, tab4, tab5 = st.tabs(["Veri Keşfi", "Görselleştirme", "Analiz", "Sıralama", "Raporlama"])
16
+
17
+ with tab1:
18
+ st.header("Veri Keşfi")
19
+
20
+ st.subheader("İhtiyaç Data")
21
+ st.write(ihtiyac_data.head())
22
+ st.write("Veri Kümesi Boyutları:", ihtiyac_data.shape)
23
+ st.write("Eksik Değer Sayısı:")
24
+ st.write(ihtiyac_data.isnull().sum())
25
+
26
+ st.subheader("Norm Fazlası Data")
27
+ st.write(norm_fazlasi.head())
28
+ st.write("Veri Kümesi Boyutları:", norm_fazlasi.shape)
29
+ st.write("Eksik Değer Sayısı:")
30
+ st.write(norm_fazlasi.isnull().sum())
31
+
32
+ with tab2:
33
+ st.header("Veri Görselleştirme")
34
+
35
+ # Histogram
36
+ st.subheader("Histogram")
37
+ numeric_columns = ihtiyac_data.select_dtypes(include=['float64', 'int64']).columns
38
+ column = st.selectbox("Histogram için bir sütun seçin", numeric_columns)
39
+ if column:
40
+ fig, ax = plt.subplots()
41
+ sns.histplot(ihtiyac_data[column], kde=True, ax=ax)
42
+ st.pyplot(fig)
43
+
44
+ # Bar Grafiği
45
+ st.subheader("Bar Grafiği")
46
+ categorical_columns = ihtiyac_data.select_dtypes(include=['object']).columns
47
+ bar_column = st.selectbox("Bar grafiği için bir sütun seçin", categorical_columns)
48
+ if bar_column:
49
+ fig, ax = plt.subplots()
50
+ ihtiyac_data[bar_column].value_counts().plot(kind='bar', ax=ax)
51
+ st.pyplot(fig)
52
+
53
+ with tab3:
54
+ st.header("Veri Analizi")
55
+
56
+ # Korelasyon Matrisi
57
+ st.subheader("Korelasyon Matrisi")
58
+ if len(numeric_columns) > 1:
59
+ corr_matrix = ihtiyac_data[numeric_columns].corr()
60
+ fig, ax = plt.subplots(figsize=(10, 8))
61
+ sns.heatmap(corr_matrix, annot=True, cmap='coolwarm', ax=ax)
62
+ st.pyplot(fig)
63
+ else:
64
+ st.write("Korelasyon analizi için yeterli sayısal sütun yok.")
65
+
66
+ # Filtreleme
67
+ st.subheader("Filtreleme")
68
+ filter_column = st.selectbox("Filtreleme için bir sütun seçin", numeric_columns)
69
+ if filter_column:
70
+ 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())))
71
+ filtered_data = ihtiyac_data[(ihtiyac_data[filter_column] >= min_value) & (ihtiyac_data[filter_column] <= max_value)]
72
+ st.write(filtered_data)
73
+
74
+ with tab4:
75
+ st.header("Sıralama")
76
+
77
+ # Sütuna göre sıralama
78
+ sort_column = st.selectbox("Sıralamak için bir sütun seçin", numeric_columns)
79
+ ascending = st.radio("Sıralama Türü", ("Artan", "Azalan")) == "Artan"
80
+ if sort_column:
81
+ sorted_data = ihtiyac_data.sort_values(by=sort_column, ascending=ascending)
82
+ st.write(sorted_data)
83
+
84
+ with tab5:
85
+ st.header("Raporlama")
86
+
87
+ # Dinamik rapor oluşturma
88
+ st.subheader("Dinamik Raporlama")
89
+ selected_columns = st.multiselect("Rapor için sütunları seçin", ihtiyac_data.columns)
90
+ if selected_columns:
91
+ st.write(ihtiyac_data[selected_columns])
92
+
93
+ # Grafik destekli rapor
94
+ st.subheader("Grafikli Raporlama")
95
+ x_axis = st.selectbox("X Ekseni için bir sütun seçin", ihtiyac_data.columns)
96
+ y_axis = st.selectbox("Y Ekseni için bir sütun seçin", ihtiyac_data.columns)
97
+ if x_axis and y_axis:
98
+ fig, ax = plt.subplots()
99
+ sns.scatterplot(data=ihtiyac_data, x=x_axis, y=y_axis, ax=ax)
100
+ st.pyplot(fig)
101
+
102
+ st.sidebar.title("Hakkında")
103
+ st.sidebar.info("Bu uygulama, veri keşfi, analiz, görselleştirme ve raporlama işlemlerini gerçekleştirmek için tasarlanmıştır.")