Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

[juliacall] how to broadcast a Julia function? #305

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Moelf opened this issue May 11, 2023 · 1 comment
Closed

[juliacall] how to broadcast a Julia function? #305

Moelf opened this issue May 11, 2023 · 1 comment
Labels
question Further information is requested

Comments

@Moelf
Copy link

Moelf commented May 11, 2023

similar to #285

@Moelf Moelf added the question Further information is requested label May 11, 2023
@cjdoris
Copy link
Collaborator

cjdoris commented May 13, 2023

Broadcasting has a special syntax in Julia which doesn't naturally translate to Python. You have a couple of options, either create a function to do the broadcasting:

f = jl.seval("x -> sqrt.(x)")
f(x)

or use the broadcast function directly:

jl.broadcast(jl.sqrt, x)

@JuliaPy JuliaPy locked and limited conversation to collaborators May 13, 2023
@cjdoris cjdoris converted this issue into discussion #306 May 13, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants