Python Forum
How do I translate this into python code? (excel vlookup)
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How do I translate this into python code? (excel vlookup)
#1
I have two dataframes and trying to do a excel vlookup type function.

excel's vlookup parameters: vlookup(lookup_value,table_array,col_index_num,range_lookup
How would I translate the following into python code?

Trying to do vlookup from df1 to df2. I dont know if I use a merge (all column names are different), map, etc. Im stuck on this problem. Im sure its a easy solution.

lookup_value: df1 column C apples
table_array: df2 A though D
col_index: df2 column D (apple_types)


below are column names...
df1
A | B | C | D
-----------------------------------
grapes|berry | apples | mango

df2
A | B | C | D
-----------------------------------
veggies|meat | drinks | apple_types

Thank you
Reply


Messages In This Thread
How do I translate this into python code? (excel vlookup) - by eeps24 - May-26-2020, 01:39 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
Photo How do you translate this in Python? pythonflea 5 2,747 Jan-24-2021, 07:58 PM
Last Post: Serafim
  Translate some code form C++ (complex vector) CarnariusXx 11 4,089 Jan-06-2021, 07:58 PM
Last Post: CarnariusXx
  Python Package for deploying python code in Excel on machines without python UGuntupalli 2 6,989 Jul-31-2019, 04:05 AM
Last Post: UGuntupalli
  How do I write a line of code into an excel spreadsheet using Python code? Emerogork 2 3,272 Feb-07-2018, 06:54 PM
Last Post: snippsat
  I'm working onn below code to extract data from excel using python kiran 1 3,350 Oct-24-2017, 01:42 PM
Last Post: kiran

Forum Jump:

User Panel Messages

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