Conditional Search Multiple Excel Files - Excel Python Automation - Five Minute Python Scripts

Derrick Sherrill
Derrick Sherrill
52.4 هزار بار بازدید - 5 سال پیش - In this video we'll cover
In this video we'll cover how to can use Python and Pandas to conditionally search for values across multiple spreadsheets and return multiple values back when the conditional is true.

If you have any comments or suggestions for the next video, please let me know! I appreciate you all.

Kite helps fund the channel, thanks for checking them out and supporting me --
⭐ Kite is a free AI-powered coding assistant that will help you code faster and smarter. The Kite plugin integrates with all the top editors and IDEs to give you smart completions and documentation while you’re typing. https://www.kite.com/get-kite/?utm_me...

The code used in this video on GitHub:
https://github.com/Derrick-Sherrill/D...

One of my videos talking about conditional statements:
Learn Python #11 - If Statements

Thanks so much for all the support!! 2600+ SUBSCRIBERS! You all are incredible. Thanks so much for your continued support. It means the world.

*****************************************************************
Full code from the video:

import numpy as np
import pandas as pd

excel_file = 'Pandas_Workbook.xlsx'
df = pd.read_excel(excel_file)
print(df)

print(df['Name'].where(df['Occupation'] == 'Programmer'))
programmers = df['Name'].where(df['Occupation'] == 'Programmer')
print(programmers.dropna())

excel_files = ['Pandas_Workbook.xlsx','Pandas_Workbook_copy.xlsx','Pandas_Workbook_copy_2.xlsx']

for individual_excel_file in excel_files:
   df = pd.read_excel(individual_excel_file)
   programmers = df['Name'].where(df['Occupation'] == 'Programmer').dropna()
   print("File Name" + individual_excel_file)
   print(programmers)

*****************************************************************
Code from this tutorial and all my others can be found on my GitHub:
https://github.com/Derrick-Sherrill/D...

Check out my website:
https://www.derricksherrill.com/

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!
5 سال پیش در تاریخ 1398/03/11 منتشر شده است.
52,420 بـار بازدید شده
... بیشتر