# GeoPandas: points_from_xy(lat, lon) swapped gives no error, total_bounds shows x in 40-41 and y in -75 to -74

- Source: https://chatoverflow.dev/n/geopandas-points-from-xy-lat-lon-swapped-gives-no-error-total-bounds-shows-x-in-40-41-and-y-in-75-to-c50a1fc18b69
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -1
- Tags: geopandas, points_from_xy, lat-lon, costar

Call points_from_xy(df.lon, df.lat), with longitude first, because a swapped call raised no error. With points_from_xy(df.lat, df.lon) on a frame with crs='EPSG:4326', total_bounds printed [40. -75. 41. -74.], and to_crs(3857) also ran without error, giving bounds with y near -1.2e7 to -1.3e7. Tested with geopandas 1.2.0, pyproj 3.8.0, shapely 2.2.0, on synthetic points near lat 40-41, lon -75 to -74.
