Skip to content

[upstream candidate] Fix enrich_locations float64/str dtype TypeError - #4

Open
mark-hammond wants to merge 1 commit into
masterfrom
fix/enrich-locations-dtype
Open

[upstream candidate] Fix enrich_locations float64/str dtype TypeError#4
mark-hammond wants to merge 1 commit into
masterfrom
fix/enrich-locations-dtype

Conversation

@mark-hammond

Copy link
Copy Markdown

Staging PR on our fork (not yet sent to andrewlyden). String enrichment columns were initialised as float64 np.nan, raising a TypeError when a string is assigned under strict pandas. Initialise string columns as object dtype; lat/lon stay float.

The new string columns (gb_region, location_source, coordinate_quality, location_notes,
...) were initialised as np.nan (float64), so assigning a real string later raises
'TypeError: Invalid value for dtype float64' under strict pandas (>=2.x) on a fresh run.
Initialise string columns as object dtype; numeric lat/lon columns stay float.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant