我对Plotly有问题。首先我的代码:
data=go.Heatmap(z=z, x=df[numerical].columns.values, y=df[numerical].columns.values,
type='heatmap', colorscale = 'Viridis', reversescale = False)
layout = go.Layout(title='Pearson Correlation of numerical features',
xaxis = dict(ticks='', nticks=36),
yaxis = dict(ticks='' ),
width = 900, height = 900)
fig = go.Figure(data=data, layout=layout)
py.iplot(fig, filename='labelled-heatmap')
此代码可以在我的kaggle笔记本中运行,没有任何问题。如果我将此代码导入到我的jupyter笔记本中。我收到以下错误:
Invalid property specified for object of type plotly.graph_objs.Heatmap: 'type'
删除类型属性时,出现以下错误:
Invalid value of type 'plotly.graph_objs._heatmap.Heatmap' received for the 'data' property of
Received value
由于我对编程还很陌生,我希望这个问题对您来说不会显得愚蠢。但是,您是否知道a)为什么在kaggle笔记本中运行相同的代码时没有任何问题,但是jupyter出现了问题; b)我该怎么办才能解决此问题?
[kaggle和您的笔记本电脑上的Plotly版本可能不匹配。
请通过以下方式更新笔记本电脑上的版本:
pip install -U plotly