Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/python-3.x/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 绘图热图与Jupyter笔记本电脑不兼容?_Python_Python 3.x_Jupyter Notebook_Plotly_Kaggle - Fatal编程技术网

Python 绘图热图与Jupyter笔记本电脑不兼容?

Python 绘图热图与Jupyter笔记本电脑不兼容?,python,python-3.x,jupyter-notebook,plotly,kaggle,Python,Python 3.x,Jupyter Notebook,Plotly,Kaggle,我对阴谋有意见。首先,我的代码是: 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

我对阴谋有意见。首先,我的代码是:

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
删除类型属性时,出现以下错误:

 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版本和你笔记本电脑上的Plotly版本不匹配

请通过以下方式更新笔记本电脑上的版本:

pip install -U plotly

kaggle上的Plotly版本和笔记本电脑上的Plotly版本可能不匹配

请通过以下方式更新笔记本电脑上的版本:

pip install -U plotly

您当前在自己的笔记本电脑上使用的Plotly版本是什么?kaggle笔记本上的版本是什么?他们可能会有所不同。非常感谢!这显然是我使用的旧版本。没有任何东西都能正常运行。欢呼您当前在自己的笔记本电脑上使用的Plotly版本是什么?kaggle笔记本上的版本是什么?他们可能会有所不同。非常感谢!这显然是我使用的旧版本。没有任何东西都能正常运行。干杯