Clean Excel Data With Python Pandas – Removing Unwanted Characters

Channel Avatar
Comment
X
Share
Clean Excel Data With Python Pandas - Removing Unwanted Characters
Clean Excel Data With Python Pandas – Removing Unwanted Characters
Hey Everyone, in this one we’re looking at the replace method in pandas to remove characters from your spreadsheet columns.

Be sure to post what you want to see next!

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_mediumreferral&utm_sourceyoutube&utm_campaignderricksherrill&utm_contentdescription-only

Support the Channel on Patreon —
https://www.patreon.com/join/derricksherrill
Join The Socials —
Reddit – https://www.reddit.com/r/CodeWithDerrick/
FB – https://www.facebook.com/CodeWithDerrick/
Insta – https://www.instagram.com/codewithderrick/
Twitter – https://twitter.com/codewithderrick
LinkedIn – https://www.linkedin.com/in/derricksherrill/
GitHub – https://github.com/Derrick-Sherrill
*****************************************************************
Full code from the video:

import pandas as pd

excel_file_path ‘office_info.xlsx’
df pd.read_excel(excel_file_path)

print(df.head(2))

for column in df.columns:
df[column] df[column].str.replace(r’//W’,/”/”)

df.to_excel(/”removed_characters.xlsx/”)

https://github.com/Derrick-Sherrill/DerrickSherrill.com/blob/master/remove_characters.py

Packages (& Versions) used in this video:
Python 3.8
Pandas 0.25
Atom 1.41

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

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?
Blue Yeti Microphone – https://amzn.to/2PcNj5d
Mic sound shield – https://amzn.to/3bVNkEt
Soundfoam – https://amzn.to/37NV9ci
Camera desk stand – https://amzn.to/3bX8xhm
Box Lights – https://amzn.to/2PanL95
Side Lights – https://amzn.to/37KSNut
Green Screen – https://amzn.to/37SFFnc

What computer do you use/desk setup?
Film on imac (4k screen) – https://amzn.to/37SEu7g
Work on Macbook Pro – https://amzn.to/2HJ5b3G
Video Storage – https://amzn.to/2Pey8sw
Mouse – https://amzn.to/2PhCtv3
Desk – https://amzn.to/37O1Mv1
Chair – https://amzn.to/2uqHE4E

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-sherrill-2/

Where do I get my music?
I get all my music from the copyright free Youtube audio library
https://www.youtube.com/audiolibrary/music?nv1

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!

Take the opportunity to connect and share this video with your friends and family if you find it useful.

Keywords: Python, Python Automation, Tutorial, How To, Derrick Sherrill, Clean, Excel, Data, Python Excel, Clean Excel, Worksheets, Spreadsheets, Python Pandas, Pandas, Dataframe, Clean Data, Regular Expressions, Regex

Read Also

Leave a Reply

Your email address will not be published. Required fields are marked *