BUG: explode() raises ValueError
See original GitHub issueHi,
as reported here https://github.com/martinfleis/momepy/issues/123, at certain situation gdf.explode()
raises ValueError: Shape of passed values is (132850, 183), indices imply (132842, 183)
. Using data retrieved from OSM using OSMnx. (Warning - Vancouver gdf is large)
import geopandas as gpd
import osmnx as ox
gdf = ox.footprints.footprints_from_place(place='Vancouver, Canada')
gdf_projected = ox.project_gdf(gdf)
exploded = gdf_projected.explode()
I tried to save a small set to geojson, but after loading back to geopandas it does not cause the error 🤔
Issue Analytics
- State:
- Created 4 years ago
- Comments:17 (9 by maintainers)
Top Results From Across the Web
Pandas explode error - column must be scalar - Stack Overflow
New in version 1.3.0: Multi-column explode. If you see this ValueError you must be using an older version of pandas.
Read more >How to Use the Pandas explode() Function? - Scaler Topics
This method raises an error in the following cases: When applying the explode() method to a dataframe: If we don't pass in any...
Read more >What's new in 1.2.0 (December 26, 2020) - Pandas
Bug in Series.loc() and Series.iloc() raising ValueError when inserting a list-like np.array , list or tuple in an object Series of equal length...
Read more >Pandas Explode Multiple Columns - Python - Linux Hint
The explode() function will also raise an error when the row-wise count of elements in a DataFrame does not match the column to...
Read more >ipaddress — IPv4/IPv6 manipulation library — Python 3.11.1 ...
A ValueError is raised if address does not represent a valid IPv4 or IPv6 address. ... IPv4 address strings are now parsed as...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@seizethedata This bug is super strange with your data. I wasn’t able to figure out what happens there nor find a workaround with current version of geopandas. But I was able to patch explode to work with your data - #1319.
@seizethedata Try
reset_index()
before exploding.