JuliaPy / JuliaPy/PyCall.jl

only first 1023 indices are converted

Offen
#892 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Julia
Sterne
1.5k
Forks
186
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

I have a file, [`stat.npy`](https://drive.google.com/open?id=1ZpbRwub-KpSnT_BJDGIAW-uh-5QJWKtl).

```julia
julia> using PyCall
julia> np = pyimport("numpy")
julia> stat = np.load("stat.npy", allow_pickle=true);
julia> cell_centers = map(x->get(x,"med"), stat)
julia> cell_centers[1023]
2-element Vector{Int64}:
477
562
julia> cell_centers[1024]
2-element Vector{PyObject}:
PyObject 211
PyObject 430
julia> pybuiltin("type")(cell_centers[1023])
PyObject
julia> pybuiltin("type")(cell_centers[1024])
PyObject
julia> pybuiltin("type")(cell_centers[1024][1])
PyObject
```
`1:1023` indices are converted properly, but `1024:end` is not. Nothing is different when loading in python. Given the closeness to a power of 2, I suspect something is going on in PyCall...?

Edit: clarified code

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.