# Pandas Dataframe

**URL:** <https://ask.openrouteservice.org/t/pandas-dataframe/3104>\
**Category:** openrouteservice\
**Created:** [August 25, 2021, 12:46pm UTC](https://ask.openrouteservice.org/t/pandas-dataframe/3104 "2021-08-25T12:46:58Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![kalabachibale](https://ask.openrouteservice.org/user_avatar/ask.openrouteservice.org/kalabachibale/32/1230_2.png) [@kalabachibale](https://ask.openrouteservice.org/u/kalabachibale)\
**Post date:** [August 25, 2021, 12:46pm UTC](https://ask.openrouteservice.org/t/pandas-dataframe/3104/1 "2021-08-25T12:46:58Z")

</div>

Is there any example of using client.directions and placing pandas latitude and longitude in the method. Any help would be greatly appreciated.

---

<div class="post-metadata">

**Author:** ![kalabachibale](https://ask.openrouteservice.org/user_avatar/ask.openrouteservice.org/kalabachibale/32/1230_2.png) [@kalabachibale](https://ask.openrouteservice.org/u/kalabachibale)\
**Post date:** [August 25, 2021, 12:48pm UTC](https://ask.openrouteservice.org/t/pandas-dataframe/3104/2 "2021-08-25T12:48:31Z")

</div>

Here is my code

```python
for EC_lon,EC_lat,WC_lon,WC_lat in zip(EC["Longitude"].values.tolist(),
                                       EC["Latitude"].values.tolist(),
                                       WC["Longitude"].values.tolist(),
                                       WC["Latitude"].values.tolist()):
    client.directions(coordinates=[[EC_lon,EC_lat],[WC_lon,WC_lat]],
                          profile='driving-car',
                          format='geojson')

```

---

<div class="post-metadata">

**Author:** ![jschnell](https://ask.openrouteservice.org/user_avatar/ask.openrouteservice.org/jschnell/32/971_2.png) [@jschnell](https://ask.openrouteservice.org/u/jschnell)\
**Post date:** [August 25, 2021, 12:58pm UTC](https://ask.openrouteservice.org/t/pandas-dataframe/3104/3 "2021-08-25T12:58:03Z")

</div>

Hey,

for an example on how to use the openrouteservice python client, have a look at [the examples in the github repo](https://github.com/GIScience/openrouteservice-py#basic-example).  
If you have further questions regarding the openrouteservice python client, feel free to ask them.

If you have questions regarding python and pandas, please redirect them to the appropriate forums, channels and other sources on the web.

Best regards

---

<div class="post-metadata">

**Author:** ![kalabachibale](https://ask.openrouteservice.org/user_avatar/ask.openrouteservice.org/kalabachibale/32/1230_2.png) [@kalabachibale](https://ask.openrouteservice.org/u/kalabachibale)\
**Post date:** [August 25, 2021, 1:15pm UTC](https://ask.openrouteservice.org/t/pandas-dataframe/3104/4 "2021-08-25T13:15:41Z")

</div>

Sure just an example of using a pandas data frame I see in the example their mostly use Tuples for the coordinates

---

<div class="post-metadata">

**Author:** ![kalabachibale](https://ask.openrouteservice.org/user_avatar/ask.openrouteservice.org/kalabachibale/32/1230_2.png) [@kalabachibale](https://ask.openrouteservice.org/u/kalabachibale)\
**Post date:** [August 26, 2021, 2:01pm UTC](https://ask.openrouteservice.org/t/pandas-dataframe/3104/5 "2021-08-26T14:01:36Z")

</div>

Got it to work:

```python
locations = DF[['Longitude','Latitude']] 

locations = locations.values.tolist()

isochrones = client.isochrones(locations = locations,
                 profile='driving-hgv',
                 range=[900, 1800, 2700, 3600], ### 900 / 60 = 15 minutes 
                 units="km",
                 attributes = ['area', 'reachfactor', 'total_pop'])

for iso in isochrones['features']:
    folium.features.GeoJson(iso,style_function=styl_func).add_to(Map)

```
