Skip to content

Commit

Permalink
Merge branch 'junk'
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisBarker-NOAA committed Sep 24, 2024
2 parents b6003dc + abcd366 commit 7941347
Showing 1 changed file with 30 additions and 2 deletions.
32 changes: 30 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
:target: https://github.com/NOAA-ORR-ERD/lat_lon_parser/




##############
lat_lon_parser
##############
Expand Down Expand Up @@ -149,4 +147,34 @@ Functions for converting to various string formats::
'23° 45\' 6.70"'


Usage with Pandas
-----------------

Question from a user:

How to apply this lat_lon_parser on pandas dataframe specific column?

Turns out it's straightforward -- just pass the `parse` function to apply::


In [20]: df = pandas.DataFrame({'coords':["12d13'N","32 5 14", "30.123W"]})

In [21]: df
Out[21]:
coords
0 12d13'N
1 32 5 14
2 30.123W

In [22]: df['coords'] = df['coords'].apply(parse)

In [23]: df
Out[23]:
coords
0 12.216667
1 32.087222
2 -30.123000




0 comments on commit 7941347

Please sign in to comment.