I'm wondering whether someone can help me with this, may be naive, issue, please? Thanks in advance for your opinion. Q: How can I use groupby to group by ['id', 'geometry']? Assuming the geopandas data reads for: pts =
id prix agent_code geometry
0 922769 3000 15 POINT (3681922.790 1859138.091)
1 1539368 3200 26 POINT (3572492.838 1806124.643)
2 922769 50 15 POINT (3681922.790 1859138.091)
3 1539368 200 26 POINT (3572492.838 1806124.643)
I have used something like this:
pts = pts.groupby(['id', 'geometry']).agg(prom_revenue=('prix',np.mean))..reset_index()
However Python raises the following error:
TypeError: '<' not supported between instances of 'Point' and 'Point'
Thanks for your help, dudes!