Tag: python_interview
Python : Python script to find all files with a specific extension in a given folder, and do a find and replace
In this article, we will guide you through writing a Python script to find all files with a .sh extension…
Python : Generate Random 500 number between 101, 999 and exclude prime numbers from it
Here’s a Python code snippet that generates a list of 500 random numbers between 11 and 99: import random random_numbers…
Python : The Vital Role of Data Visualization and Top Python Libraries for Effective Visualization
Data visualization plays a pivotal role in the era of big data, enabling businesses to understand complex datasets and extract…
Python : How to recover python code from .pyc file
Recovering the exact Python source code from a compiled .pyc file is not straightforward. The .pyc file contains the bytecode…
Python : How to bind a function to an instance of a class in Python
from types import MethodType In Python, MethodType from the types module allows you to bind a function to an instance…
Python : set object is not subscriptable – Resolved
The “set object is not subscriptable” error occurs when you try to access a set element using indexing or slicing,…
Python : How to split a list into batch of specific number in python
Here I have a list of 5500 elements , I want to split in to batches of 1000. You can use…
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…