如何解决朱莉娅UndefVarError:取消移位!没有定义的
我使用julia 1.4,并运行以下代码:
using PyCall
using JLD
using ArgParse
using Pandas
@pyimport networkx as nx
@pyimport scipy.sparse.csgraph as csg
@pyimport numpy as np
unshift!(PyVector(pyimport("sys")["path"]),"")
# unshift!(PyVector(pyimport("sys")["path"]),"..")
unshift!(PyVector(pyimport("sys")["path"]),"combinatorial")
@pyimport utils.load_graph as lg
@pyimport utils.distortions as dis
@pyimport graph_util as gu
....
运行此代码时,出现以下错误:
ERROR: LoadError: UndefVarError: unshift! not defined
Stacktrace:
[1] top-level scope at /root/hyperbolics/combinatorial/comb.jl:9
[2] include(::Module,::String) at ./Base.jl:377
[3] exec_options(::Base.JLOptions) at ./client.jl:288
[4] _start() at ./client.jl:484
in expression starting at /root/hyperbolics/combinatorial/comb.jl:9
当我搜索文档时,不要动!是julia 1.4中的现有函数,所以我不明白为什么会发生此错误。我是茱莉亚的新手,请帮忙。
解决方法
不动!是julia 1.4中的现有功能
您在哪里看到的?两年前,它已被Julia 1.0改名为pushfirst!
:
julia> pushfirst!([1,2,3],4)
4-element Array{Int64,1}:
4
1
2
3
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。