Cannot convert 2d array from numpy to julia
- Vorherrschende Sprache
- Julia
- Sterne
- 1.5k
- Forks
- 186
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
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?
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Rechercherichtung
Das PyPlot-Beispiel `plt.subplots(2, 2)` reproduzieren und das zurückgegebene `PyObject`-Array mit `PyArray(ax)` und `convert(Array, ax)` vergleichen. Den Array-Konvertierungspfad von PyCall für NumPy-Objekt-Arrays nachverfolgen; als abgeschlossen gilt die Aufgabe, wenn ein 2D-Array von Achsen normale Julia-Indizierung wie `ax[end, end]` unterstützt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- julia, numpy, python
- Bereich
- backend
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100