Replace Excel Vlookup with Python - Five Minute Python Scripts

Replace Excel Vlookup with Python - Five Minute Python Scripts


Full Code From This Example:

YouTube Description:

Subscriber special! We'll look at how we can replace the vlookup function in excel using python and pandas. We'll cover: - Reading in multiple excel sheets - Merging dataframes - Renaming column names - Exporting to Excel #Python #Excel #Automation If you have your own request on what you want to see. Please let me know! I'm happy to help. THANK YOU ALL for so much support! You all are incredible. 3150+ Subscribers, I'm so glad you all enjoy the content enough to follow me. You all are awesome. ***************************************************************** Full code from the video: import pandas as pd import numpy as np initial_workbook = 'A.xlsx' info_workbook = 'B.xlsx' output_workbook = 'output.xlsx' df_initial = pd.read_excel(initial_workbook) df_info = pd.read_excel(info_workbook) # print(df_initial.columns) # print(df_info.columns) df_initial.rename(columns={'Code':'IDs'}, inplace=True) df_3 = pd.merge(df_initial, df_info[['IDs','ID']], on='IDs', how='left') print(df_3) df_3.rename(columns={'IDs':'Code'}, inplace=True) df_3 = df_3.replace(np.nan, '', regex=True) print(df_3) df_3.to_excel(output_workbook, index=False) Or find it on my Github here: ***************************************************************** Code from this tutorial and all my others can be found on my GitHub: Check out my website: If you liked the video - please hit the like button. It means more than you know. Thanks for watching and thank you for all your support!! Always looking for suggestions on what video to make next -- leave me a comment with your project! Happy Coding!

Enjoy this content? Consider Subbing to the Youtube channel

Derrick Sherrill

By: Derrick Sherrill

Thanks for visiting my page! I'm working hard to make the best content I can for you. I love watching people learn and teaching others. Happy Coding!

Become a Patreon!