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