ceckenrode commited on
Commit
4a4533c
·
1 Parent(s): 57a7ac5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -12
app.py CHANGED
@@ -18,16 +18,13 @@ if uploaded_file is not None:
18
  # Generate a treemap or sunburst plot based on data types
19
  numerical_cols = df.select_dtypes(include=["float", "int"]).columns
20
  categorical_cols = df.select_dtypes(include=["object"]).columns
21
-
22
- fig = px.treemap(df, path=categorical_cols)
23
- st.plotly_chart(fig)
24
 
25
- # if len(numerical_cols) >= 2:
26
- # fig = px.scatter_matrix(df, dimensions=numerical_cols)
27
- # st.plotly_chart(fig)
28
- # elif len(categorical_cols) >= 2:
29
- # fig = px.treemap(df, path=categorical_cols)
30
- # st.plotly_chart(fig)
31
- # else:
32
- # fig = px.sunburst(df, path=categorical_cols + numerical_cols)
33
- # st.plotly_chart(fig)
 
18
  # Generate a treemap or sunburst plot based on data types
19
  numerical_cols = df.select_dtypes(include=["float", "int"]).columns
20
  categorical_cols = df.select_dtypes(include=["object"]).columns
 
 
 
21
 
22
+ if len(numerical_cols) >= 2:
23
+ fig = px.scatter_matrix(df, dimensions=numerical_cols)
24
+ st.plotly_chart(fig)
25
+ elif len(categorical_cols) >= 2:
26
+ fig = px.treemap(df, path=categorical_cols)
27
+ st.plotly_chart(fig)
28
+ else:
29
+ fig = px.sunburst(df, path=categorical_cols + numerical_cols)
30
+ st.plotly_chart(fig)