Skip to content

Pass symbol to Julia function #308

@jdupl123

Description

@jdupl123

I am trying to pass a symbol to the hclust function from http://juliastats.github.io/Clustering.jl/stable/hclust.html

from julia import Clustering as C
result = hclust(costs, linkage=":ward")

I keep getting

TypeError: in #hclust, in typeassert, expected Symbol, got String

I also tried

from julia import Main as M
C.hclust(costs, linkage=M.Symbol('ward'))

but same error. I believe this is because PyCall is converting the symbol to a string before passing it through.

Current work around is:

jl = Julia(compiled_modules=False)
M.costs = costs
ctree=jl.eval('hclust(costs, linkage=:ward)')

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions