On 08/12/16 12:06, Ilya Kostanovskiy wrote:

I am trying to create a new dataset out of existing 2D dataset using
standard numpy command. I would like to sum along row and column. From
the control line the command

sum([[1,2],[2,3]], axis=0) or sum([[1,2],[2,3]], axis=1)

works and gives normal output. If I use it as an expression on the menu
for creating a new dataset then it fails:

sum(/2d_datasetname/_data,axis=0).

It only works if I remove axis property and sums along the rows.

Does someone know the trick how to use this numpy expression properly?

I think this is because the environment functions are executed in is different from the command line. The sum function seems to be the standard python sum, not the numpy function.

As a workaround, you can add a custom import for sum from numpy in the Custom Definitions dialog box. This seems to work ok for me (though I haven't tried the _data subscript.

I'll try to remember to fix this, but file a bug to remind me if you have time.

Cheers

Jeremy



_______________________________________________
Veusz-discuss mailing list
Veusz-discuss@gna.org
https://mail.gna.org/listinfo/veusz-discuss

Répondre à