veganism.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
Veganism Social is a welcoming space on the internet for vegans to connect and engage with the broader decentralized social media community.

Administered by:

Server stats:

295
active users

#Dataframe

0 posts0 participants0 posts today
Erik-Jan<p>I was annoyed that there is no "expand_grid()" function in :python: <a href="https://fosstodon.org/tags/Python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Python</span></a> as in :rstats: <a href="https://fosstodon.org/tags/RStats" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>RStats</span></a> <a href="https://fosstodon.org/tags/tidyverse" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>tidyverse</span></a> </p><p>So I just published a small package on <a href="https://fosstodon.org/tags/PyPI" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>PyPI</span></a> !</p><p>Introducing polarsgrid<br><a href="https://pypi.org/project/polarsgrid/" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="">pypi.org/project/polarsgrid/</span><span class="invisible"></span></a></p><p>Using the excellent <a href="https://fosstodon.org/tags/polars" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>polars</span></a> 🐻‍❄️ package, easily create a table with product of factors: </p><p>from polarsgrid import expand_grid<br>expand_grid(a=[1, 2, 3], b=["x", "y"])</p><p>Yields all combinations of its inputs as a <a href="https://fosstodon.org/tags/DataFrame" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>DataFrame</span></a></p><p>It can also produce a <a href="https://fosstodon.org/tags/LazyFrame" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>LazyFrame</span></a> for streaming extra-big tables to disk</p>
r⁵py<p>Computing travel time matrices in r⁵py from <span class="h-card" translate="no"><a href="https://fosstodon.org/@geopandas" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>geopandas</span></a></span> <a href="https://mapstodon.space/tags/DataFrame" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>DataFrame</span></a> is two lines of code: </p><p>(1) create an r5py.TransportNetwork from <span class="h-card" translate="no"><a href="https://en.osm.town/@openstreetmap" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>openstreetmap</span></a></span> and <a href="https://mapstodon.space/tags/GTFS" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>GTFS</span></a> data</p><p>(2) turn it into an r5py.TravelTimeMatrix()</p><p>Try it out in <a href="https://mapstodon.space/tags/binder" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>binder</span></a>: <a href="https://r5py.readthedocs.io/stable/user-guide/user-manual/quickstart.html" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">r5py.readthedocs.io/stable/use</span><span class="invisible">r-guide/user-manual/quickstart.html</span></a></p>
gdmcbain<p>Parsing CSV with units in the header · Issue #166 · hgrecco/pint-pandas</p><p><a href="https://github.com/hgrecco/pint-pandas/issues/166" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">github.com/hgrecco/pint-pandas</span><span class="invisible">/issues/166</span></a></p><p>Now we can read a <a href="https://fosstodon.org/tags/csv" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>csv</span></a> file with a header like `time / s,mass / g` into <a href="https://fosstodon.org/tags/pandas" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>pandas</span></a> and call `.pint.quantify()` to get a <a href="https://fosstodon.org/tags/dataframe" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>dataframe</span></a> in which the columns have <a href="https://fosstodon.org/tags/units" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>units</span></a> as in <a href="https://fosstodon.org/tags/Pints" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Pints</span></a> !</p><p>Handy for CSV restricted to single-row headers, as in Confluence Databases and Microsoft Lists.</p>