Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -60,21 +60,20 @@ if uploaded_files:
|
|
| 60 |
|
| 61 |
selected_out = st.select("เลือก columns ที่จะดู Outlier", value=False)
|
| 62 |
if selected_out:
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
st.write(outliers)
|
| 78 |
|
| 79 |
|
| 80 |
st.markdown("Data transform")
|
|
|
|
| 60 |
|
| 61 |
selected_out = st.select("เลือก columns ที่จะดู Outlier", value=False)
|
| 62 |
if selected_out:
|
| 63 |
+
col = selected_out
|
| 64 |
+
st.write(f"คอลัมน์ {col}:")
|
| 65 |
+
|
| 66 |
+
# Calculate Z-Scores for the selected column
|
| 67 |
+
z_scores = np.abs((df[col] - df[col].mean()) / df[col].std())
|
| 68 |
+
|
| 69 |
+
# Set a threshold for identifying outliers (e.g., z_score > 3)
|
| 70 |
+
threshold = 3
|
| 71 |
+
|
| 72 |
+
# Identify outliers
|
| 73 |
+
outliers = df[z_scores > threshold]
|
| 74 |
+
|
| 75 |
+
st.write("Outliers:")
|
| 76 |
+
st.write(outliers)
|
|
|
|
| 77 |
|
| 78 |
|
| 79 |
st.markdown("Data transform")
|