0

I am new to python and need some help please. I am looking at AirBnB data for a country over several months and noticed that for some later months, some fields have not been extracted in the source files. I have appended all the months' data together and the dataframe contains data for a city from Aug 2018 - Jan 2021 (with Jul 2020- Sep 2020 missing/ not available). I am thinking of using the equivalent of vlookup into python, so that I am able to find AirBnB_ID in the section of the dataframe from 2018-2020 June, to fill the missing data in the dataframe from Oct 2020- Jan 2021 such as number of bathrooms, bedroom, guests_included and bed_type. I have not been able to find how to do this yet and would really appreciate any help.

If there is a better way than what I am thinking, I would also welcome the thought.

Appreciate any support I can get. Thank you.

  • It seems risky to do this because of the possibility that its inaccurate. What if there was some moving around of furniture or construction which changed the number of rooms or what have you? – mechanical_meat Apr 19 '21 at 01:08
  • 2
    Here is a similar question whose answers may prove useful. https://stackoverflow.com/questions/25493625/vlookup-in-pandas-using-join – Anupam Chand Apr 19 '21 at 01:14

1 Answers1

0

You can do the equivalent of a vlookup in python using the pandas library. https://www.geeksforgeeks.org/how-to-do-a-vlookup-in-python-using-pandas/

Yin
  • 96
  • 6