JuliaPy / JuliaPy/pyjulia

Pass symbol to Julia function

Open
#308 6 comments 1 reaction 0 assignees View on GitHub
PyCall
Dominant language
Python
Stars
893
Forks
101
PR merge metrics
No merged PRs in 30d

Description

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)')
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.