У меня возникла проблема при попытке показать простой график с результатами 3 команд, он не может быть преобразован в ColumnDataSource, ваша помощь приветствуется !!
Я новичок в Bokeh, и Python вв общем, и могли бы использовать некоторые советы, если у этого кода есть серьезные проблемы!
#importing libraries
from bokeh.plotting import figure
from bokeh.io import output_file, show
import pandas as pd
from bokeh.models import ColumnDataSource
# initialize list of lists
data = [['HR', 68, 76], ['MA', 69, 72], ['FI', 70, 74]]
# Create the pandas DataFrame
dfTeam = pd.DataFrame(data, columns = ['name', 'current_score', 'previous_score'])
# assign a color code
colormap={'HR':'red', 'MA':'green','FI':'blue'}
dfTeam['color']=[colormap[x] for x in dfTeam['name']]
HRsrc=ColumnDataSource(dfTeam[dfTeam['name']=='HR'])
MAsrc=ColumnDataSource(dfTeam[dfTeam['name']=='MA'])
FIsrc=ColumnDataSource(dfTeam[dfTeam['name']=='FI'])
####define the output file path
output_file('test.html')
###create figure object
f=figure()
###adding glyphs
f.circle(x='current_score', y='previous_score',
fill_alpha=0.2, color='color', legend='HR', source='HRsrc')
f.circle(x='current_score', y='previous_score',
fill_alpha=0.2, color='color', legend='MA', source='MAsrc')
f.circle(x='current_score', y='previous_score',
fill_alpha=0.2, color='color', legend='FI', source='FIsrc')
##save and show the figure
show(f)