Skip to content

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

Closed

Description

@Moelf

similar to #285

Activity

  1. cjdoris commented on May 13, 2023

    @cjdoris
    Member

    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)
  2. locked and limited conversation to collaborators on May 13, 2023
  3. converted this issue into a discussion #306 on May 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions