Python comes with a built-in module called json; pip is not required to instal it.…
Tag: Python
Python : Dynamically access or modify object attributes [ getattr and setattr ]
getattr and setattr are built-in Python functions that allow you to dynamically get and set attributes of an object, respectively….
Python : ZIP file from an S3 bucket, split it into smaller ZIP files, and save those directly to the S3 bucket
To read a large ZIP file from an S3 bucket, split it into smaller ZIP files, and save those directly…
Python : If the current row date is null or blank then get the date from the previous row and fill it using Pandas
You can use the fillna() method in pandas with the ffill() method to fill the null values in a DataFrame…
Python : What is the advantage of giving arrow (->) arrow notation in function ?
Using the -> arrow notation in function definitions provides type hints, which have several advantages: Readability: Type hints make the…
Python : Find and remove the last occurrence of specific string in python
To find and remove the last occurrence of a specific substring in a string, you can use the str.rfind() method…
Python : Extracting Time Components and Converting Timezones with Python
In this article, we will be working with a dataset containing a column with names, ages, and timestamps. Our goal…
Shell : Deleting empty subdirectories in a directory
In Unix-based operating systems, it is common to write shell scripts to automate tasks. One common task is deleting empty…
Shell : Sync a folder from one Linux instance to another Linux instance in a specific path.
In Linux-based operating systems, it is common to synchronize files between different instances. One way to do this is by…
Shell : Script that iterates all it directory and sub directory and find the word search and print the complete file path.
One common task is searching for a specific word in all files in a directory and its subdirectories. This is…
Shell : Script that takes a file name as an argument and checks if it’s readable or not.
One common task is checking if a file is readable before proceeding with a script. This is useful to prevent…