JuliaPy / JuliaPy/PyCall.jl

indexing using pycall get differs from python

Offen
#234 3 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 read this:

Given o::PyObject, get(o, key) is equivalent to o[key] in Python, with automatic type conversion. To get as a PyObject without type conversion, do get(o, PyObject, key), or more generally get(o, SomeType, key). You can also supply a default value to use if the key is not found by get(o, key, default) or get(o, SomeType, key, default)

With this I successfully sliced a Python object ndarray in the first direction using:
image = get(image, PyObject, 5:70)
The problem is that I want to be able to do (in python) img[5:70, 5:200], use multiple arguments in brackets, but when typing
image = get(image, PyObject, 5:70, 5:200)
the second argument in seen as the default argument. So wouldn't it be nice to be able to give multiple arguments using get?

image = get(image, PyObject, (5:70, 5:200)) results in

LoadError: Only two or three spatial dimensions are permitted
while loading In[55], in expression starting on line 102
in call at /home/frank/.julia/v0.4/ImageView/src/display.jl:143
in view at /home/frank/.julia/v0.4/ImageView/src/display.jl:239
in obtainDataFromImages at In[55]:88
[inlined code] from In[55]:108
in anonymous at no file:0

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.