JuliaPy / JuliaPy/PyCall.jl

No-copy version of PyReverseDims for NumPy to Julia arrays

Open
#695 4 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Julia
Stars
1.5k
Forks
186
PR merge metrics
No merged PRs in 30d

Description

It would be great if there was an equivalent of `PyReverseDims` for the other direction, e.g. a method that takes a `PyArray` and returns a regular Julia Array with the dimensions inverted. For things like images from PIL, the numpy array of size `(nvertical, nhorizontal, ncolor)` mostly comes from NumPy arrays being row-major. In Julia, an array of size `(ncolor, nhorizontal, nvertical)` also feels natural because Julia is column-major. These two arrays would have the same representation in memory, but I cannot figure out how to accomplish this conversion without copying the underlying data, even when using `reinterpret` or `resize`.

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.