<div dir="auto"><div data-smartmail="gmail_signature" dir="auto"><br></div><br><div class="gmail_quote" dir="auto"><div dir="ltr">On Fri, Feb 15, 2019, 09:17 Markus Neteler <<a href="mailto:neteler@osgeo.org">neteler@osgeo.org</a> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto"><div>Hi,<br><br><div class="gmail_quote"><div dir="ltr">Am Do., 14. Feb. 2019, 15:50 hat César Augusto Ramírez Franco <<a href="mailto:caesarivs@gmail.com" target="_blank" rel="noreferrer">caesarivs@gmail.com</a>> geschrieben:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div dir="ltr"><div class="gmail_default" style="color:rgb(39,78,19)">Greetings,<br><br>I have a municipality polygon layer with a poverty index (percent) and a population count, I'm multiplying them to visualize the vulnerability for each municipality, due to the distribution of that new variable I want to compute the logarithm, which is not possible in sqlite,</div></div></div></blockquote></div></div><div dir="auto"><br></div><div dir="auto">Yes but there is an extension for this.</div><div dir="auto"><br></div><div dir="auto">See</div><div dir="auto"><a href="https://grasswiki.osgeo.org/wiki/Build_SQLite_extension_on_Linux" target="_blank" rel="noreferrer">https://grasswiki.osgeo.org/wiki/Build_SQLite_extension_on_Linux</a><br></div><div dir="auto"><br></div><div dir="auto">It may solve the issue.</div><div dir="auto"><br></div><div dir="auto">Best</div><div dir="auto">Markus</div><div dir="auto"><br></div><div dir="auto"></div></div></blockquote></div><div dir="auto"><br></div><div dir="auto">Thanks!</div><div dir="auto"><br></div><div dir="auto">That's actually pretty neat! I'll test this in the lab's computers this week.</div><div dir="auto"><br></div><div class="gmail_quote" dir="auto"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto"><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div dir="ltr"><div class="gmail_default" style="color:rgb(39,78,19)">so I tried reading the column with numpy and issuing a np.log10(). I'm happy with the result, but how can I get this new numpy array to a new column in the vector map in a simple way?<br><br>This is what I already have:<br><br><span style="font-family:monospace,monospace">#!/usr/bin/env python<br><br>import grass.script as gs<br>import numpy as np<br>import matplotlib.pyplot as plt<br><br>nbi_pob = np.array(gs.vector_db_select("muniant", columns = "nbi_pob")["values"].values()).astype(float).squeeze()<br><br>plt.hist(nbi_pob)<br>plt.show()<br><br>log_nbi_pob = np.log10(nbi_pob)<br><br>plt.hist(log_nbi_pob)<br>plt.show()</span><br><br>I'm trying to introduce this kind of analysis to students who are not familiar nor proficient with programming (this is an GIS introductory course) so the numpy bit is already complex enough to them, and I'd like to avoid using for loops with cursors to achieve this.<br><br>Is there a simple solution to this?<br clear="all"></div><br>-- <br><div dir="ltr" class="m_3882502099044202914m_3536590185693155109gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div><b>César Augusto Ramírez Franco</b></div></div></div></div></div></div></div></div></div></div></div>
_______________________________________________<br>
grass-user mailing list<br>
<a href="mailto:grass-user@lists.osgeo.org" rel="noreferrer noreferrer" target="_blank">grass-user@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/grass-user" rel="noreferrer noreferrer noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/grass-user</a></blockquote></div></div></div>
</blockquote></div></div>