profile

Pandas Daily

Beginner to Expert in Python in just 5 minutes

Featured Post

😰 We can't escape Python's escape sequences

Welcome back to Pandas Daily! Your daily 5-minute boost to becoming confident in Python. I am sure when you print C:\new_folder your code breaks due to \. Or you wonder how to print single (It's) or double ("Hello") quotes. Enter Escape Sequences, tiny backslash commands in Python that fix all of this. πŸ‘‰ Most common uses: Format using new lines Print tabs Single or double quotes in text Write file paths safely Print symbols like Ο€ or❀️ Let's Begin... πŸ‘‡ \n Print in next line - the one we all...

Welcome back to Pandas Daily! Your daily 5-minute boost to becoming confident in Python. Think about the time you waste right-clicking and saving course lectures on YouTube one-by-one. Inefficient process, can cause errors and you lose focus. pytubefix eliminates that bottleneck. Today is day 3 of mastering YouTube with Python. You already know how to get stats of a single video; or download them in various formats. Now time to level up with playlists. Pytubefix has a Playlist object that...

Welcome back to Pandas Daily! Your daily 5-minute boost to becoming confident in Python. Yesterday we introduced pytubefix - a powerful module to access YouTube. We downloaded a video as well. Cool, but basic. What if you want 1080p instead of 480p. Or prefer WebM over MP4. To answer all this - let's cover downloads in depth today. 🀫 I am 100% sure you can charm recruiters or your colleagues as they won't know this! πŸ“₯ Code Recap: How to download YouTube video In: # Import library from...

Welcome back to Pandas Daily! Your daily 5-minute boost to becoming confident in Python. We all watch YouTube - almost daily. Only a few however know how to control it with Python. Today we will use pytubefix - a Python library that provides access to YouTube. Know video stats (# views, upload date) or download them, all in a line of code ⚠️ Note: Respect YouTube’s terms and download only content you own or have permission for. πŸ“¦ Install pytubefix In: pip install pytubefix Out: 🏑 Basic...

Welcome back to Pandas Daily! Your daily 5-minute boost to becoming confident in Python. I am sure you are excited for the weekend. So am I. Today is our last stop in regex! You now know how to fetch phones, emails, names from any text. There is one more layer that makes regex powerful. With that you can - catch both color, colour match Nov, November irrespective of how they are written Extract both $ and 200 from a $200 invoice, and more.. 🎁 Bonus at the end: A great resource with 30 regex...

Welcome back to Pandas Daily! Your daily 5-minute boost to becoming confident in Python. Yesterday we saw how you can extract emails using regex. Today let's expand a bit on emails and later go through the core characters (you know 80% regex if you know these) that power any regex. I can't emphasize much on how powerful regex is, hence we are covering it in multiple days. Tomorrow might be the last. 🎯 match() to check validity of email You can refer to yesterday's issue to understand below...

Welcome back to Pandas Daily! Your daily 5-minute boost to becoming confident in Python. Yesterday we kicked off our journey on regex - a worldwide tool used to match patterns in text. After nailing phone numbers, today we will push further to extract real text patterns - like emails or person's name. This is the same trick recruiters use to scan resumes and grab contacts in seconds. πŸš€ w+ to find all words w represents single character; + means one or more In: import re text = "Regex makes...

Welcome back to Pandas Daily! Your daily 5-minute boost to becoming confident in Python. Ever wondered how websites or apps identify a valid phone or email. Or mask sensitive info like SSN, passwords. All this runs on regular expressions (regex) - patterns that describe text. In Python, we use re module to search, extract, split and replace these patterns with ease. πŸ‘‹ Basics - Import/Load the module In: import re Out: 🧐 Find if the word exists In: text = "I love Pandas Daily"...

Welcome back to Pandas Daily! Your daily 5-minute boost to becoming confident in Python. Hope your weekend was great! I am sure we didn't waste it organizing the abundant files on our computers. There is a simple automation in Python that does this in few lines of code. 🌱 Import/Load needed modules We covered shutil on Friday, and os earlier. In: import os, shutil Out: 🎯 Select folder that needs cleanup In: desktop = os.path.expanduser("~/Desktop") print(desktop) Out: /home/user/Desktop ✏️...

Welcome back to Pandas Daily! Your daily 5-minute boost to becoming confident in Python. Irrespective of whatever work you do, you definitely have a lot going on with the files, folders on your computers. There are a LOT OF THEM. Today, let look at Python's shutil module which can organize them in few lines of code. πŸ“₯ Import/Load the modules and get ready os module will be used to interact (access files) with operating system. Quick refresher here. In: import shutil, os Out: πŸ“‹ Copy files In:...