0

I am try to attach a column to a dataframe whose elements sholud be automatically compiled depending on the elements of another column. In this case I need to attach the coordinates of a particular place. There can be repetitions in the dataframe. Here's an example:

I have a Dataframe

 Time    Adress 
13:00    Straight Ave.
13:45    Uphill Cr.
15:30    Narrow Rd.
15:45    Broad Way
16:35    Tiny Square
18:25    Broad Way
18:40    Uphill Cr.
19:20    Narrow Rd.
20:00    Dunkel Alley

And a coordinates Dataframe

Adress          Loc. Coord x   Loc. Coord y
Broad Way       10237871       89809209
Dunkel Alley    10236790       89883490
Narrow Rd.      10227398       89482378
Straight Ave.   10238700       89834782
Tiny Square     10237894       89803248
Uphill Cr.      10439002       89802380

And wolud like to attach the two local coordinates columns to the first dataframe in the right order. I have tried to use match but I think it doesn't allows repetitions, i.e. the two dataframes must have the same length. Anybody has an idea? Thanks.

Frannzz
  • 103
  • 1
  • 3
  • 11

1 Answers1

0
merge(df1, df2, by = "Adress")

Think this should work.

Kalees Waran
  • 659
  • 6
  • 13