Spaces:
Runtime error
Runtime error
Changed % charts to Pie chart view
Browse files
app.py
CHANGED
|
@@ -120,15 +120,26 @@ def analyze_dataframe(df, max_unique_for_categorical=20):
|
|
| 120 |
)
|
| 121 |
st.plotly_chart(fig_count, use_container_width=True)
|
| 122 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 123 |
with col2:
|
| 124 |
-
#
|
| 125 |
-
fig_percent = px.
|
| 126 |
-
|
| 127 |
-
|
| 128 |
title=f"Percentage Distribution of {col_name}",
|
| 129 |
-
|
| 130 |
)
|
| 131 |
st.plotly_chart(fig_percent, use_container_width=True)
|
|
|
|
| 132 |
|
| 133 |
# Display frequency table
|
| 134 |
freq_df = pd.DataFrame({
|
|
|
|
| 120 |
)
|
| 121 |
st.plotly_chart(fig_count, use_container_width=True)
|
| 122 |
|
| 123 |
+
# with col2:
|
| 124 |
+
# # Bar chart of percentages
|
| 125 |
+
# fig_percent = px.bar(
|
| 126 |
+
# x=value_percentages.index,
|
| 127 |
+
# y=value_percentages.values,
|
| 128 |
+
# title=f"Percentage Distribution of {col_name}",
|
| 129 |
+
# labels={'x': col_name, 'y': 'Percentage (%)'}
|
| 130 |
+
# )
|
| 131 |
+
# st.plotly_chart(fig_percent, use_container_width=True)
|
| 132 |
+
|
| 133 |
with col2:
|
| 134 |
+
# Pie chart of percentages
|
| 135 |
+
fig_percent = px.pie(
|
| 136 |
+
names=value_percentages.index,
|
| 137 |
+
values=value_percentages.values,
|
| 138 |
title=f"Percentage Distribution of {col_name}",
|
| 139 |
+
hole=0.3 # Optional: to make it a donut chart
|
| 140 |
)
|
| 141 |
st.plotly_chart(fig_percent, use_container_width=True)
|
| 142 |
+
|
| 143 |
|
| 144 |
# Display frequency table
|
| 145 |
freq_df = pd.DataFrame({
|