Q:

Use values in a dataframe as keys to replace value from a second dataframe

I have the following two dataframes:
near0   near1   near2
SCSCO   LFLAF   GOMAN
VDJUL   MEIRA   L3N05
LOSEN   AMCLF   PIRF2
AOSSF   MEPRI   FLLCA

and
  key   vlaue
SCSCO   _1234
VDJUL   _4321
PIRF2   _5677

How can I replace (or add a new column) such that either
near0   near1   near2
_1234   LFLAF   GOMAN
_4321   MEIRA   L3N05
LOSEN   AMCLF   _5677
AOSSF   MEPRI   FLLCA

or
near0   near1   near2   near0_f   near1_f   near2_f
SCSCO   LFLAF   GOMAN     _1234     LFLAF     GOMAN
VDJUL   MEIRA   L3N05     _4321     MEIRA     L3N05
LOSEN   AMCLF   PIRF2     LOSEN     AMCLF     _5677
AOSSF   MEPRI   FLLCA     AOSSF     MEPRI     FLLCA

hold?

A:

You can do replace pass series 
newdf1=df1.replace(df2.set_index('key').vlaue)
   near0  near1  near2
0  _1234  LFLAF  GOMAN
1  _4321  MEIRA  L3N05
2  LOSEN  AMCLF  _5677
3  AOSSF  MEPRI  FLLCA

