In this article, we will see how to use the ellipsis slicing syntax in Python. Before understanding ellipsis slicing, it is important to understand the slicing concept in Python. Slicing is used to extract a portion of an array or…
In this article, we will see how to implement a sliding window or rolling iterator in Python. Assume we have a sequence of elements and we want to process the data in a fixed length every time. In such a…
In this article, we will see how to build a numpy array from the generator. Using generator functions we can iterate over an infinite sequence of values without storing them in a memory. They are particularly useful when dealing with…
The distribution of input data to each layer during the training process of deep neural networks may change as the network learns. This process is known as internal covariate shift and this can disrupt the optimization process. Using BatchNormaliaztion we…
In this article, we will see how to calculate the md5 from a large file in Python. Using the hashlib module in Python, we can generate the MD5 hash of a file. The hashlib module has various hash functions including…
For debugging, monitoring, and analyzing code execution, logging is critical in any software development process. Along with the log traces, it is sometimes useful to have the source file name and line number of the log message to determine where…
Generator functions are used to generate values on-demand, one at a time, which makes them memory-efficient and ideal for processing extensive or infinite datasets. While generators excel at sequential data processing, they maintain an inherent state. Once a generator object…
In this article, we will see different ways to extract the name of an exception that was caught in Python. Getting the name of the exception is very important to further debug the code and identify the actual issue. Using…
In this article, we will see how to find the day of the week from a date provided by the user. Using Python’s built-in datetime module, we can determine the day of the week from a given date. Let’s first…
In this article, we will see how to resolve the cross-origin request blocked error in golang. When a browser encounters a request from a different origin, it sends an HTTP OPTIONS request to the server before making the actual request….