Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -17,24 +17,27 @@ def feature_select(dataset, feature, hue = None):
|
|
17 |
df = pd.read_csv(dataset.name)
|
18 |
non_numeric_cols = df.select_dtypes('object').columns.tolist()
|
19 |
|
20 |
-
plot1 = plt.figure()
|
21 |
-
if hue:
|
22 |
-
sns.histplot(data = df, x = df[feature], kde = True, hue = hue)
|
23 |
-
else:
|
24 |
-
sns.histplot(data = df, x = df[feature], kde = True)
|
25 |
-
|
26 |
if feature in non_numeric_cols:
|
|
|
27 |
plot2 = plt.figure()
|
28 |
if hue:
|
29 |
-
sns.countplot(x =
|
30 |
else:
|
31 |
-
sns.countplot(x =
|
32 |
else:
|
|
|
33 |
plot2 = plt.figure()
|
34 |
if hue:
|
35 |
-
sns.boxplot(x =
|
36 |
else:
|
37 |
-
sns.boxplot(x = df
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38 |
|
39 |
return plot1, plot2
|
40 |
|
|
|
17 |
df = pd.read_csv(dataset.name)
|
18 |
non_numeric_cols = df.select_dtypes('object').columns.tolist()
|
19 |
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
if feature in non_numeric_cols:
|
21 |
+
kde = False
|
22 |
plot2 = plt.figure()
|
23 |
if hue:
|
24 |
+
sns.countplot(x = feature, data = df, palette='rainbow', hue = hue)
|
25 |
else:
|
26 |
+
sns.countplot(x = feature, data = df, palette='rainbow')
|
27 |
else:
|
28 |
+
kde = True
|
29 |
plot2 = plt.figure()
|
30 |
if hue:
|
31 |
+
sns.boxplot(x = feature, data = df, hue = hue)
|
32 |
else:
|
33 |
+
sns.boxplot(x = feature, data = df )
|
34 |
+
|
35 |
+
plot1 = plt.figure()
|
36 |
+
if hue:
|
37 |
+
sns.histplot(data = df, x = feature, kde = kde, hue = hue, multiple="stack")
|
38 |
+
else:
|
39 |
+
sns.histplot(data = df, x = feature, kde = kde)
|
40 |
+
|
41 |
|
42 |
return plot1, plot2
|
43 |
|