Skip to content

Commit

Permalink
Update dashboard_CLOUD.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Isdinval authored Jun 6, 2024
1 parent d6bad79 commit 22a1a5c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions dashboard_CLOUD.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,10 +319,13 @@ def main():
st.write(count_customer)


# Find the bin index for the customer value
customer_bin_index = np.digitize(customer_value, bins=bins) - 1 # Adjust for zero-based indexing

# Create bar chart with bins
fig, ax = plt.subplots()
ax.bar(bins_all[:-1], counts_all, color='gray', alpha=0.7, label='All Clients') # Use bins[:-1] for correct bar placement
ax.bar(bins_all[-1], count_customer, color='red', label='Current Customer') # Last bin for customer value
ax.bar(bins_all[:-1], counts_all, color='gray', alpha=0.7, label='All Clients')
ax.bar(bins_all[customer_bin_index], count_customer, color='red', label='Current Customer') # Use customer_bin_index
ax.set_xlabel(selected_feature) # Adjust label based on feature
ax.set_ylabel('Count')
ax.set_title(f'Distribution of {selected_feature} (Binned)')
Expand All @@ -331,7 +334,6 @@ def main():
st.pyplot(plt.gcf())




# # Create line plot with highlighting
# plt.plot(full_data_values, color='gray', label='All Clients', alpha=0.7) # Add transparency for better visibility
Expand Down

0 comments on commit 22a1a5c

Please sign in to comment.