octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: python with octave project (Pythonic)


From: Nader Nabil
Subject: Re: python with octave project (Pythonic)
Date: Mon, 16 Mar 2020 19:33:36 +0200

I need to understand the project more to start write my purposal 

On Sat, Mar 14, 2020, 00:21 Nader Nabil <address@hidden> wrote:
i have read pythonic documentation and i have some questions 
https://wiki.octave.org/Pythonic

from Ideas section : 
1-
"This works only when all the keys for the dict are strings." 
x = pyeval ("{1:'one',2:'two'}"); 
but the key here is not string and it is working 
note :      x.("1") ... this syntax generates the following error for me : 

error: AttributeError: 'dict' object has no attribute '1'
error: called from
    subsref at line 42 column 9

but this syntax worked : x{1}  , ans = one


2-  
Element indexing on a list or other sequence object with a range or set of indices doesn't return the right number of output arguments.

code :

x = py.list ({1, 2, 3, 4, 5, 6});
x{1:3}
y = {x{1:3}};

current output : 
y =
{
  [1,1] =
  {
    [1,1] =  1
    [1,2] =  2
    [1,3] =  3
  }
}

 Is this the correct wanted output : 
y = [1.0 , 2.0 , 3.0]  ?
 



On Mon, Mar 9, 2020 at 2:23 PM Colin Macdonald <address@hidden> wrote:
On 2020-03-09 8:16 a.m., Nader Nabil wrote:
> my octave version is *GNU Octave, version 4.2.2  .
> *Do i have to  install another version ?

I suspect so.  What is the minimal version required for Pythonic?  This
should be documented somewhere, like in DESCRIPTION.  If not, that's
probably a bug you should file with Pythonic.  And then fix that bug ;-)

Colin

reply via email to

[Prev in Thread] Current Thread [Next in Thread]