I have a data frame, named, Score
Source_of_crisis Score_sum Risk_bucket
0 Credit 7.3348 Red
1 Credit sentiment 4.0008 Green
2 Deposits 4.8750 Green
3 Equity market 5.1106 Yellow
4 FTP / Profitability 4.6250 Green
5 Interest rate 4.0012 Green
6 International economics 4.0000 Green
7 News 4.0000 Green
I want to:
- plot horizontal bar chart in Jupyter notebook
- Same in streamlit
Code for notebook:
# Dependencies
from bokeh.plotting import figure, show
from bokeh.io import output_notebook
x = Score['Source_of_crisis']
y = Score['Score_sum']
p = figure(
title='simple chart',
x_axis_label='x',
y_axis_label='y')
p.hbar(x, y, legend_label='Trend', line_width=2)
output_notebook()
show(p)
Result: a frame is being created with a title and legend label. No figure inside.
What am I doing wrong?
Secondly, how would I do the same in streamlit?
