Spaces:
Sleeping
Sleeping
mihaeladuta commited on
Commit ·
924bfab
1
Parent(s): 1aba3ba
Tweaked plots.
Browse files- src/pages/1_Outputs_submissions.py +4 -2
- src/process.py +2 -2
src/pages/1_Outputs_submissions.py
CHANGED
|
@@ -21,11 +21,13 @@ st.write(f"Number of submitted outputs: {dset.shape[0]}")
|
|
| 21 |
for column in [cb.COL_OUTPUT_TYPE_NAME, cb.COL_OPEN_ACCESS]:
|
| 22 |
dset_stats = proc.calculate_counts(dset, column, sort=False)
|
| 23 |
st.write(dset_stats)
|
| 24 |
-
column_to_plot = "
|
| 25 |
fig, ax = plt.subplots()
|
|
|
|
| 26 |
dset_stats[column_to_plot].plot.barh(legend=False,
|
| 27 |
xlabel="",
|
| 28 |
-
ylabel=
|
|
|
|
| 29 |
ax=ax,
|
| 30 |
)
|
| 31 |
ax.set_xlim([0, 100])
|
|
|
|
| 21 |
for column in [cb.COL_OUTPUT_TYPE_NAME, cb.COL_OPEN_ACCESS]:
|
| 22 |
dset_stats = proc.calculate_counts(dset, column, sort=False)
|
| 23 |
st.write(dset_stats)
|
| 24 |
+
column_to_plot = "records (%)"
|
| 25 |
fig, ax = plt.subplots()
|
| 26 |
+
title = f"{column}: {column_to_plot}"
|
| 27 |
dset_stats[column_to_plot].plot.barh(legend=False,
|
| 28 |
xlabel="",
|
| 29 |
+
ylabel="",
|
| 30 |
+
title=title,
|
| 31 |
ax=ax,
|
| 32 |
)
|
| 33 |
ax.set_xlim([0, 100])
|
src/process.py
CHANGED
|
@@ -10,8 +10,8 @@ def calculate_counts(dset, col, sort=True):
|
|
| 10 |
sort (bool): Whether to sort the counts.
|
| 11 |
"""
|
| 12 |
|
| 13 |
-
col_count = "
|
| 14 |
-
col_perc = "
|
| 15 |
dset_stats = dset[col].value_counts(sort=sort).to_frame(name=col_count)
|
| 16 |
dset_stats[col_perc] = 100 * dset_stats[col_count] / dset.shape[0]
|
| 17 |
dset_stats.index.name = col
|
|
|
|
| 10 |
sort (bool): Whether to sort the counts.
|
| 11 |
"""
|
| 12 |
|
| 13 |
+
col_count = "records"
|
| 14 |
+
col_perc = "records (%)"
|
| 15 |
dset_stats = dset[col].value_counts(sort=sort).to_frame(name=col_count)
|
| 16 |
dset_stats[col_perc] = 100 * dset_stats[col_count] / dset.shape[0]
|
| 17 |
dset_stats.index.name = col
|