Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -388,22 +388,12 @@ def main():
|
|
| 388 |
color_order = ['#36516E', '#99CCE0', '#D6DCE5', '#A5A5A5', '#636363', '#74A9E8']
|
| 389 |
df_triplet['color'] = df_triplet[response_col].apply(get_response_color)
|
| 390 |
|
| 391 |
-
# Create the dictionary that defines the order for sorting
|
| 392 |
-
sorterIndex = dict(zip(color_order, range(len(color_order))))
|
| 393 |
|
| 394 |
-
#
|
| 395 |
-
# the dataframe numerically
|
| 396 |
-
df_triplet['color_rank'] = df_triplet['color'].map(sorterIndex)
|
| 397 |
|
| 398 |
-
df_triplet.
|
| 399 |
-
|
| 400 |
-
df_triplet.
|
| 401 |
-
|
| 402 |
-
# # works for color
|
| 403 |
-
|
| 404 |
-
# df_triplet.color = df_triplet.color.astype("category")
|
| 405 |
-
# df_triplet.color = df_triplet.color.cat.set_categories(color_order)
|
| 406 |
-
# df_triplet.sort_values(["color"])
|
| 407 |
|
| 408 |
|
| 409 |
# Create a pie chart object
|
|
|
|
| 388 |
color_order = ['#36516E', '#99CCE0', '#D6DCE5', '#A5A5A5', '#636363', '#74A9E8']
|
| 389 |
df_triplet['color'] = df_triplet[response_col].apply(get_response_color)
|
| 390 |
|
|
|
|
|
|
|
| 391 |
|
| 392 |
+
# works for color
|
|
|
|
|
|
|
| 393 |
|
| 394 |
+
df_triplet.color = df_triplet.color.astype("category")
|
| 395 |
+
df_triplet.color = df_triplet.color.cat.set_categories(color_order)
|
| 396 |
+
df_triplet.sort_values(["color"])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 397 |
|
| 398 |
|
| 399 |
# Create a pie chart object
|