JuliaPy / JuliaPy/PyCall.jl

Cannot convert 2d array from numpy to julia

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

Description

I use `PyPlot`, and `plt.subplots` returns an array of axes:
```
using PyPlot
fig, ax = plt.subplots(2, 2)
```
Before a recent update, `ax` was a Julia `AbstractMatrix`, so it supported all normal array operations. Now it is
```
PyObject array([[,
],
[,
]],
dtype=object)
```
and I cannot do e.g. `ax[end, end]`. Converting explicitly also does not work as expected: `PyArray(ax)` gives `KeyError: key "O" not found` (I guess it doesn't support object arrays yet?), and `convert(Array, pg.ax)` gives a 1d array of `PyObject` arrays, instead of a 2d array of axes.

Am I missing something, or array conversion like this is not implemented yet?

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.