Create a Class in Python3

python

So how do you create a class in Python3? What is class? Why do we need a class? All great questions. My Computer Setup Python3 (Finally getting used to adding parentheses around my print statements ) macOS What is an object? So let’s go over what a class is. Classes are the preliminary step to …

Read more

Filter a Pandas DataFrame in Python

python

We’ll be showing you how filter a Pandas DataFrame in Python. So let’s set the scene. You work for a massive food company that sells deli meats and fruits. You’ve been toiling at your computer for hours trying to create a dataframe of your company’s product info. Department XYZ needs that data so they can …

Read more

Clone a Git Repo in Python3

python

So you want to clone a git repo in Python3? I recently came across a case where I wanted to programmatically edit and update a Github repo and what better language to use than Python? My first go at the problem had me thinking of .bat files since I come from a Windows background. Therefore …

Read more

Making A Twitter Bot With Tweepy

python

Want help making a Twitter bot with Tweepy? It’s actually pretty easy after you apply for a developer’s account and setup an app on Twitter’s side. You can do the application and setup here. My Computer Setup Python3 (Finally getting used to adding parentheses around my print statements ) macOS Getting your Environment Setup You …

Read more

Programmatically Renaming File Paths with Python

python

Programmatically renaming file paths with Python has made my life easier in more ways than we have time for in this article. Am I being dramatic? Most definitely. That being said, it is a ridiculously time saving hack to learn. For example did your company’s name recently change and now you’re faced with updating a …

Read more

Modulos in Python

python

Modulos in Python are super useful. They can we be used when we don’t want to print a check each pass during a loop. For example, if I’m looping through 100,000 numbers and want to get an update of how my automation is going every so often instead of printing each loop or blindly running …

Read more

Python Lambda Functions For Idiots

python

What are Python Lambda Functions? They weren’t something I could easily infer from casually seeing it in code or context clues. I had to do a little digging. What I took from my reading, is that they are more concisely written functions. My Setup Python 3.x macOS Example They make this: Into this: I personally …

Read more

Drop Duplicates From An Array In Python

python

So, you need to drop duplicates from an array in Python. Maybe you’re iterating through this array and calling an api and need to cut down on the super expensive networking? Regardless, it’s fairly straight forward. My Setup Python 3.xmacOS The Solution We use set() to drop duplicates from an array in Python. A set …

Read more

Unconverted Data Remains Error While Using strptime in Python

python

To start off, screw the unconverted data remains error while using strptime in Python 2.x or 3.x. Of the many Python errors I’ve gotten this has to be one of the more vague ones. That being said, I do hate working with times and dates. Regardless, here’s your solution. My Setup Python 3.xmacOS Recreating the …

Read more

Dropping Duplicates From A Pandas DataFrame

python

Dropping duplicates from a Pandas DataFrame came into my purview when I noticed a script which contained a ton of networking was sloooooooow. Unfortunately, the endpoint didn’t support asynchronous API calls, so I was stuck getting the job done the ol’ fashioned way. My Setup Python 3.xmacOS The Problem I had tons of data in …

Read more