How to Rename Files and Directories in Python (os.rename, pathlib)
Programmatically Renaming File Paths with Python
Feral Cat - Software Development
Building, just becauseā¦
Programmatically Renaming File Paths with 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
I recently spent a few hours trying to understand why my array was changing when using the splice method. I thought I’d save you some time and outline what I learned. Still new to JS and struggling with the fundamentals? Check out Javascript: The Defenitive Guide (paid link) to brush up. For Those of You … Read more
The solution for those of you who want me to cut the crap and need to calculate a random integer from 0 to n in Javascript. My Setup macOS Node v12.10.0 The Problem I was writing a React-Native game where I had multiple cards that would be presented to the player. To spice up the … Read more
I recently encountered a scenario where I needed to store an array of objects locally for later retrieval. The challenge was converting this array of objects into a string before saving it and then cast a string array of JSON objects to JSON. This led me to figure out how to cast a string array … Read more
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 Example They make this: Into this: I personally think they’re beautiful … Read more
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
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 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
So you’re getting the TypeError: argument of type ‘int’ is not iterable error message. I came across this issue when calling an api, extracting some data from a json object, and trying to determine if I needed to do something with that info. Bite Size Soln for Those in a Rush In short, you’re trying … Read more