In [1]:
%matplotlib inline

import geopandas as gpd
import pysal as ps
import pandas as pd
import numpy as np
from shapely.geometry import Point

Obtain a point dataset

In [2]:
pts = gpd.read_file(ps.examples.get_path('columbus.shp')).centroid
pts.plot();

Extract XY coords. into columns

In [3]:
xys = pd.DataFrame(pts.apply(lambda pt: pd.Series({'X': pt.x, 'Y': pt.y})))
xys.head()
Out[3]:
X Y
0 8.827218 14.369076
1 8.332658 14.031624
2 9.012265 13.819719
3 8.460801 13.716962
4 9.007982 13.296366

Pack XY coords into geometry

In [4]:
new_pts = gpd.GeoDataFrame({'geometry': 
                            xys.apply(lambda r: Point(r['X'], r['Y']), axis=1)
                           }, crs=pts.crs)
new_pts.plot()
Out[4]:
<matplotlib.axes._subplots.AxesSubplot at 0x1236d6198>