使用simple_plotly时如何解决“ NameError:名称'plotly_version'未定义”?

时间:2019-07-03 12:07:05

标签: python plotly jupyter

我正在尝试为我的硕士论文代码绘制地图。现在,我只是尝试使用https://nbviewer.jupyter.org/github/e2nIEE/pandapower/blob/develop/tutorials/plotly_maps.ipynb中的示例,因此我认为一切都应该正常工作。但是,当尝试使用函数“ simple_plotly”时,会出现NameError。我如何设法使其正常工作?

这是我收到错误的行:

Collection<Foo> foo = blah.stream().filter(somePredicate).collect(Collectors.toList());
if (foo.isEmpty()) {
  throw new Exception("blah");
}

错误

from pandapower.plotting.plotly import simple_plotly
from pandapower.networks import mv_oberrhein
net = mv_oberrhein()
simple_plotly(net, on_map=True, projection='epsg:31467')

1 个答案:

答案 0 :(得分:0)

发生此错误是因为未安装plotly,请使用pip安装ploty,它将起作用。

if (answer101[0].checked) {
            document.getElementById("question101_answer").style.color = "green";
            document.getElementById("question101_answer").innerHTML = "&#10004";
            score += 1;
        } else {
            document.getElementById("question101_answer").style.color = "red";
            document.getElementById("question101_answer").innerHTML = "&#10006 Wrong!";
        }