Update app.py
Browse files
app.py
CHANGED
|
@@ -199,14 +199,18 @@ def create_component_for_analysis_for_single_df(selected_files, dfs, i):
|
|
| 199 |
create_for_bivariate_analysis(selected_files, df, i)
|
| 200 |
|
| 201 |
def create_for_bivariate_analysis(selected_files, df, i):
|
|
|
|
|
|
|
|
|
|
| 202 |
target_column = st.selectbox("Select the target column ", df.columns.values,
|
| 203 |
key= "bivariate_target_column_" + str(i))
|
| 204 |
bivariate_columns = st.multiselect("Select the columns to analyse ", df.columns.values,
|
| 205 |
key= "bivariate_analysis_columns_" + str(i))
|
| 206 |
|
| 207 |
for col in bivariate_columns:
|
| 208 |
-
|
| 209 |
-
|
|
|
|
| 210 |
# 3 any other aggregation function can be used based on column type
|
| 211 |
|
| 212 |
|
|
|
|
| 199 |
create_for_bivariate_analysis(selected_files, df, i)
|
| 200 |
|
| 201 |
def create_for_bivariate_analysis(selected_files, df, i):
|
| 202 |
+
with st.sidebar:
|
| 203 |
+
# st.subheader("Visualisation Type")
|
| 204 |
+
viz_type = st.radio("What type of Visualisation?",("Cross Tab",'Box Plot'))
|
| 205 |
target_column = st.selectbox("Select the target column ", df.columns.values,
|
| 206 |
key= "bivariate_target_column_" + str(i))
|
| 207 |
bivariate_columns = st.multiselect("Select the columns to analyse ", df.columns.values,
|
| 208 |
key= "bivariate_analysis_columns_" + str(i))
|
| 209 |
|
| 210 |
for col in bivariate_columns:
|
| 211 |
+
if viz_type == 'Cross Tab':
|
| 212 |
+
st.subheader(f"{col} --> {target_column}")
|
| 213 |
+
st.write(pd.crosstab(df[target_column], df[col], margins=True))
|
| 214 |
# 3 any other aggregation function can be used based on column type
|
| 215 |
|
| 216 |
|