Python Forum
trying to do a vlookup in pandas
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
trying to do a vlookup in pandas
#1
Trying to do a "vlookup" with pandas. I have two data frames loaded. I suppose I would need to do a merge to connect both data frames. But my question is, how do I tell it which column to bring in for my result?I dont want to bring in all the columns, just a particular one. like in the vlookup sytax of "col_index_num"

excel vlookup syntax: vlookup(lookup_value,table_array,col_index_num,range_lookup)

say I merge df1 and df2 on colA, I want the result to bring in column B.

df1
df2
Reply
#2
curious if anyone knows? thank you
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Vlookup function in Pyhton antozas 1 639 Oct-02-2023, 04:16 AM
Last Post: vikraman
  "Vlookup" in pandas dataframe doug2019 3 1,850 May-09-2022, 01:35 PM
Last Post: snippsat
  Python VLookup? Lookup Table? Nu2Python 3 2,404 Oct-25-2021, 08:47 PM
Last Post: Nu2Python
  How to apply VLookup formula jonzee 2 3,530 Jan-12-2020, 04:16 PM
Last Post: Clunk_Head
  VLOOKUP Equivalent using openpyxl DJBuck 2 9,133 Mar-17-2019, 02:03 PM
Last Post: DJBuck

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020