Hey Everyone! In this one we'll talk a look at how we can break down a workbook into multiple other workbooks depending ont he value inside a column.
We do it here for all unique values in one of our columns, but you could do the conditional indexing any way you like. I hope this shows you the baseline of how to do it!
Support the Channel on Patreon --
/ derricksherrill
Join The Socials --
Reddit - / codewithderrick
FB - / codewithderrick
Insta - / codewithderrick
Twitter - / codewithderrick
LinkedIn - / derricksherrill
GitHub - https://github.com/Derrick-Sherrill
*****************************************************************
Workbook -
https://drive.google.com/file/d/12p1q...
Full code from the video:
import pandas as pd
excel_file_path = 'training_status.xlsx'
df = pd.read_excel(excel_file_path)
print(df)
split_values = df['Shift'].unique()
print(split_values)
for value in split_values:
df1 = df[df['Shift'] == value]
output_file_name = "Shift_" + str(value) + "_Trainings.xlsx"
df1.to_excel(output_file_name, index=False)
https://github.com/Derrick-Sherrill/D...
Packages (& Versions) used in this video:
Pandas 0.25.0
Python 3.8
*****************************************************************
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!!
--- Channel FAQ --
What text editor do you use?
Atom - https://atom.io/
What Equipment do you use to film videos?
https://www.amazon.com/shop/derricksh...
What editing software do you use?
Adobe CC - https://www.adobe.com/creativecloud.html
Premiere Pro for video editing
Photoshop for images
After Effects for animations
Do I have any courses available?
Yes & always working on more!
https://www.udemy.com/user/derrick-sh...
Where do I get my music?
I get all my music from the copyright free Youtube audio library
https://www.youtube.com/audiolibrary/...
Let me know if there's anything else you want answered!
-------------------------
Always looking for suggestions on what video to make next -- leave me a comment with your project! Happy Coding!
On this page of the site you can watch the video online Separate Excel Data into Workbooks by Column Values - Python Pandas Tutorial with a duration of hours minute second in good quality, which was uploaded by the user Derrick Sherrill 08 January 2020, share the link with friends and acquaintances, this video has already been watched 43,003 times on youtube and it was liked by 1.4 thousand viewers. Enjoy your viewing!