Skip to content
Advertisement

Tag: vlookup

Excel like vlookup using python pandas with some conditions

I need to perform vlookup on dataframe using python/pandas like in Excel with some conditions. Condition:- I need to create a one new column (DFM) in my 2nd DataFrame using Excel like vlookup. If DFM value is na then print 100% in 2nd Dataframe’s DFM. Like in below result data. In result data DFM column I need to apply vlookup

Connect the dots in pandas

TLDR I want to do the equivilent of an Excel VLOOKUP in pandas. The unique thing about this question is that the exact values I am looking up do not exist. I want to do a linear interpolation to look up the nearest value, so the usual .map approach does not work. Question I have a pandas series, with columns

Advertisement