# Attempting to get the distance between two Point objects. Getting AttributeError: 'GeoSeries' object has no attribute '_geom'

I am a beginner in GIS. Using the code below to get the distance between two Point objects from two separate GeoDataframe. Using the shapely distance function.

Can someone please explain to me what I am doing wrong?

``````import geopandas as gpd

# Point #1

# Point #2
stop_pt = stations_data.loc[stations_data.name == '34th St - Hudson Yards', 'geometry']

# Calculate the distance between the 2 points
``````
``````---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
----> 1 dist = stop_pt.distance(pt)

~\anaconda3\envs\gis\lib\site-packages\shapely\geometry\base.py in distance(self, other)
440     def distance(self, other):
441         """Unitless distance to other geometry (float)"""
--> 442         return self.impl['distance'](self, other)
443
444     def hausdorff_distance(self, other):

~\anaconda3\envs\gis\lib\site-packages\shapely\topology.py in __call__(self, this, other)
44     def __call__(self, this, other):
45         self._validate(this)
---> 46         self._validate(other, stop_prepared=True)
47         d = c_double()
48         retval = self.fn(this._geom, other._geom, byref(d))

~\anaconda3\envs\gis\lib\site-packages\shapely\topology.py in _validate(self, ob, stop_prepared)
15
16     def _validate(self, ob, stop_prepared=False):
---> 17         if ob is None or ob._geom is None:
18             raise ValueError("Null geometry supports no operations")
19         if stop_prepared and hasattr(ob, 'prepared'):

~\anaconda3\envs\gis\lib\site-packages\pandas\core\generic.py in __getattr__(self, name)
5272             if self._info_axis._can_hold_identifiers_and_holds_name(name):
5273                 return self[name]
-> 5274             return object.__getattribute__(self, name)
5275
5276     def __setattr__(self, name: str, value) -> None:

AttributeError: 'GeoSeries' object has no attribute '_geom'
``````

``````dist = stop_pt.values[0].distance(address_pt.values[0])
Or maybe you are looking for calculating the distance between all `stations_data` and all `address_pt`. You can do it with a simple line.
``````stations_data['geometry'].apply(lambda x: address_pts.distance(x)).unstack()