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

Publié le: 01 juin 2019
sur la chaîne: Derrick Sherrill
57,153
1.2k

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!


Sur cette page du site, vous pouvez voir la vidéo en ligne Conditional Search Multiple Excel Files - Excel Python Automation - Five Minute Python Scripts durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur Derrick Sherrill 01 juin 2019, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 57,153 fois et il a aimé 1.2 mille téléspectateurs. Bon visionnage!