CSE 163
Dissolve and Joins
��Hunter Schafer
Geopandas
2
import geopandas as gpd
df = gpd.read_file('data_File.shp')
df.plot(column='some_col', legend=True)
plt.savefig('plot.png')
Matplotlib
3
fig, ax = plt.subplots(1)
<plot1>(ax=ax)
<plot2>(ax=ax)
fig.savefig('plot.png')
Dissolve
4
Join
5
tas.merge(grading, left_on='ta_id',
right_on='grader_id')
ta_name | ta_id |
Ryan | 1 |
James | 2 |
Nicole | 3 |
grader_id | student_name |
2 | Flora |
3 | Paul |
1 | Wen |
3 | Andrew |
ta_name | ta_id | grader_id | student_name |
Ryan | 1 | 1 | Wen |
James | 2 | 2 | Flora |
Nicole | 3 | 3 | Paul |
Nicole | 3 | 3 | Andrew |
Types of Join
There are interesting questions of what happens if there are rows that don’t “line up”. Different type of joins differ in how to handle this case.
Types of Joins
left.merge(right, left_on=’lcol’, right_on=’rcol’,
how=’type’)
6
Hurricane Florence
7
Group Work:
Best Practices
When you first working with this group:
Tips:
8