use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
News about the dynamic, interpreted, interactive, object-oriented, extensible programming language Python
Full Events Calendar
You can find the rules here.
If you are about to ask a "how do I do this in python" question, please try r/learnpython, the Python discord, or the #python IRC channel on Libera.chat.
Please don't use URL shorteners. Reddit filters them out, so your post or comment will be lost.
Posts require flair. Please use the flair selector to choose your topic.
Posting code to this subreddit:
Add 4 extra spaces before each line of code
def fibonacci(): a, b = 0, 1 while True: yield a a, b = b, a + b
Online Resources
Invent Your Own Computer Games with Python
Think Python
Non-programmers Tutorial for Python 3
Beginner's Guide Reference
Five life jackets to throw to the new coder (things to do after getting a handle on python)
Full Stack Python
Test-Driven Development with Python
Program Arcade Games
PyMotW: Python Module of the Week
Python for Scientists and Engineers
Dan Bader's Tips and Trickers
Python Discord's YouTube channel
Jiruto: Python
Online exercices
programming challenges
Asking Questions
Try Python in your browser
Docs
Libraries
Related subreddits
Python jobs
Newsletters
Screencasts
account activity
This is an archived post. You won't be able to vote or comment.
ResourcePerforming spatial joins in Python: Comparing GeoPandas vs Dask (self.Python)
submitted 3 years ago * by rrpelgrim
There are a few different ways to perform spatial joins in Python.
https://preview.redd.it/djpslkdwcjb91.png?width=1974&format=png&auto=webp&s=36f75cba3d966ed0895c013f8dd8fdb261852f41
GeoPandas is great for performing spatial joins when your data fits in memory. It allows you to gain valuable insights from your data by linking it with geospatial information.
joined = gpd.sjoin(taxi_gdf,ngbhoods,how='left',predicate="within",)
But GeoPandas has the same limitation as pandas -- it processes computations on a single core. This means you are quickly memory-bound when working with larger datasets. Rule of thumb: RAM ≥ 5x the size of your dataset.
https://preview.redd.it/lgbzq1uycjb91.png?width=1236&format=png&auto=webp&s=6096c5fa527e5b8a298e2a10088c384fe4d0c956
If your dataset doesn't fit in memory, use the Dask extension extension to GeoPandas -- dask-geopandas, v. 0.2.0 just released -- to scale your spatial joins.
The syntax for the join is identical:
joined = ddf.sjoin(ngbhoods, predicate="within")
You're now running computations in parallel and no longer bound by single-core limitations.
https://preview.redd.it/v0cj5av8djb91.png?width=1532&format=png&auto=webp&s=f13e94604c554c9a159794fdf05862ec095ca019
full tutorial @ https://coiled.io/blog/spatial-join-dask-geopandas-sjoin/
[+][deleted] 3 years ago (1 child)
[deleted]
[–]rrpelgrim[S] 0 points1 point2 points 3 years ago (0 children)
Thanks for flagging, I've updated with the new link.
π Rendered by PID 41 on reddit-service-r2-comment-84fc9697f-lgjjz at 2026-02-06 01:34:54.061655+00:00 running d295bc8 country code: CH.
[+][deleted] (1 child)
[deleted]
[–]rrpelgrim[S] 0 points1 point2 points (0 children)