Re: [GRASS-dev] Write array to (point) attribute table

2015-10-02 Thread Paulo van Breugel
On 01-10-15 17:49, Vaclav Petras wrote: On Thu, Oct 1, 2015 at 11:28 AM, Paulo van Breugel > wrote: with VectorTopo('testB', mode='rw') as vectormap: At the and it makes sense. 'w' removes the vectors and starts over. 'rw' keep

Re: [GRASS-dev] Write array to (point) attribute table

2015-10-01 Thread Michel Wortmann
Hi Paulo, I had the same problem some time ago. I am using pandas for a lot of things and discovered the quickest way to append a column to a vector table is using pandas' .to_sql dataframe method. Here is my full function for it: import pandas as pa dataframe = pa.DataFrame( ... ) def

Re: [GRASS-dev] Write array to (point) attribute table

2015-10-01 Thread Vaclav Petras
On Thu, Oct 1, 2015 at 11:28 AM, Paulo van Breugel wrote: > with VectorTopo('testB', mode='rw') as vectormap: At the and it makes sense. 'w' removes the vectors and starts over. 'rw' keep the file but ones it for writing. Perhaps 'a' would make better sense in this

Re: [GRASS-dev] Write array to (point) attribute table

2015-10-01 Thread Paulo van Breugel
Hi Michel, Thanks! I think I got the suggestions by Anna, Pietro and Moritz working, but this certainly looks like an handy function to have at hand. One possible disadvantage if using this in a script to be shared with others is that it would add an dependency on pandas, wouldn't it?

Re: [GRASS-dev] Write array to (point) attribute table

2015-10-01 Thread Pietro
On Thu, Oct 1, 2015 at 10:01 AM, Michel Wortmann wrote: > Hi Paulo, > I had the same problem some time ago. I am using pandas for a lot of things > and discovered the quickest way to append a column to a vector table is > using pandas' .to_sql dataframe method. Here is my

Re: [GRASS-dev] Write array to (point) attribute table

2015-10-01 Thread Paulo van Breugel
On 01-10-15 09:15, Moritz Lennert wrote: On 01/10/15 00:05, Paulo van Breugel wrote: On 30-09-15 17:52, Paulo van Breugel wrote: On 30-09-15 17:47, Anna Petrášová wrote: On Wed, Sep 30, 2015 at 11:20 AM, Paulo van Breugel wrote: On 30-09-15 16:18, Anna

Re: [GRASS-dev] Write array to (point) attribute table

2015-10-01 Thread Moritz Lennert
On 01/10/15 00:05, Paulo van Breugel wrote: On 30-09-15 17:52, Paulo van Breugel wrote: On 30-09-15 17:47, Anna Petrášová wrote: On Wed, Sep 30, 2015 at 11:20 AM, Paulo van Breugel wrote: On 30-09-15 16:18, Anna Petrášová wrote: On Wed, Sep 30, 2015

Re: [GRASS-dev] Write array to (point) attribute table

2015-09-30 Thread Pietro
On Wed, Sep 30, 2015 at 9:51 AM, Paulo van Breugel wrote: > > > On Wed, Sep 30, 2015 at 2:02 AM, Anna Petrášová > wrote: >> >> >> >> On Tue, Sep 29, 2015 at 6:09 PM, Paulo van Breugel >> wrote: >>> >>> This must be a very

Re: [GRASS-dev] Write array to (point) attribute table

2015-09-30 Thread Paulo van Breugel
On Wed, Sep 30, 2015 at 11:53 AM, Pietro wrote: > On Wed, Sep 30, 2015 at 9:51 AM, Paulo van Breugel > wrote: > > > > > > On Wed, Sep 30, 2015 at 2:02 AM, Anna Petrášová > > wrote: > >> > >> > >> > >> On Tue, Sep 29, 2015 at

Re: [GRASS-dev] Write array to (point) attribute table

2015-09-30 Thread Paulo van Breugel
On 30-09-15 17:52, Paulo van Breugel wrote: On 30-09-15 17:47, Anna Petrášová wrote: On Wed, Sep 30, 2015 at 11:20 AM, Paulo van Breugel wrote: On 30-09-15 16:18, Anna Petrášová wrote: On Wed, Sep 30, 2015 at 9:27 AM, Paulo van Breugel

Re: [GRASS-dev] Write array to (point) attribute table

2015-09-30 Thread Moritz Lennert
On 30/09/15 15:27, Paulo van Breugel wrote: On Wed, Sep 30, 2015 at 11:53 AM, Pietro > wrote: On Wed, Sep 30, 2015 at 9:51 AM, Paulo van Breugel > wrote: > > > On Wed,

Re: [GRASS-dev] Write array to (point) attribute table

2015-09-30 Thread Anna Petrášová
On Wed, Sep 30, 2015 at 11:20 AM, Paulo van Breugel wrote: > > > On 30-09-15 16:18, Anna Petrášová wrote: > > > > On Wed, Sep 30, 2015 at 9:27 AM, Paulo van Breugel < > p.vanbreu...@gmail.com> wrote: > >> >> >> On Wed, Sep 30, 2015 at 11:53 AM,

Re: [GRASS-dev] Write array to (point) attribute table

2015-09-30 Thread Paulo van Breugel
On 30-09-15 17:47, Anna Petrášová wrote: On Wed, Sep 30, 2015 at 11:20 AM, Paulo van Breugel > wrote: On 30-09-15 16:18, Anna Petrášová wrote: On Wed, Sep 30, 2015 at 9:27 AM, Paulo van Breugel

Re: [GRASS-dev] Write array to (point) attribute table

2015-09-30 Thread Paulo van Breugel
On 30-09-15 16:18, Anna Petrášová wrote: On Wed, Sep 30, 2015 at 9:27 AM, Paulo van Breugel > wrote: On Wed, Sep 30, 2015 at 11:53 AM, Pietro > wrote: On Wed, Sep

[GRASS-dev] Write array to (point) attribute table

2015-09-29 Thread Paulo van Breugel
This must be a very basic question, but I can't find an easy/direct way to do this. In python, if I have an array with values with a length equal to the number of rows in an attribute table of a (point) vector layer, how can I write those values to a new column in that attribute table. I can of

Re: [GRASS-dev] Write array to (point) attribute table

2015-09-29 Thread Anna Petrášová
On Tue, Sep 29, 2015 at 6:09 PM, Paulo van Breugel wrote: > This must be a very basic question, but I can't find an easy/direct way to > do this. In python, if I have an array with values with a length equal to > the number of rows in an attribute table of a (point)