Pranav Indukuri

Pranav Indukuri

18 Articles Published

Articles by Pranav Indukuri

Page 2 of 2

How to match any non-digit character in Python using Regular Expression?

Pranav Indukuri
Pranav Indukuri
Updated on 24-Mar-2026 7K+ Views

A regular expression is a group of characters that allows you to use a search pattern to find a string or a set of strings. RegEx is another name for regular expressions. The re module in Python is used to work with regular expressions. In this article, we learn how to extract non-digit characters in Python using regular expressions. We use \D+ regular expression in Python to get non-digit characters from a string. Where, \D returns a match that does not contain digits. + implies one or more ...

Read More

How to match at the end of string in python using Regular Expression?

Pranav Indukuri
Pranav Indukuri
Updated on 24-Mar-2026 16K+ Views

A regular expression in Python is a set of characters that allows you to use a search pattern to find a string or a group of strings. These are used within Python using the re package. To match at the end of string in Python using regular expressions, we use the $ metacharacter which anchors the pattern to the end of the string. Understanding the Pattern The common pattern to match word characters at the end of a string is: \w+$ Here: ...

Read More

How to match at the beginning of string in python using Regular Expression?

Pranav Indukuri
Pranav Indukuri
Updated on 24-Mar-2026 13K+ Views

A regular expression in Python is a group of characters that allows you to use a search pattern to find a string or set of strings. RegEx is a term for regular expressions. To work with regular expressions in Python, use the re package. Understanding String Matching in Python String matching is a basic Python method that allows you to look for and find patterns in a given text. The match() function, a component of the re (regular expression) package, is one of the widely used methods for this purpose. Use the match() method to determine whether ...

Read More

How do you split a list into evenly sized chunks in Python?

Pranav Indukuri
Pranav Indukuri
Updated on 24-Mar-2026 3K+ Views

Sometimes it is necessary to divide a lengthy list into smaller and easy-to-read data. For example, if you wish to arrange a list of items in groups, it can be helpful to break it into small parts. This is useful for tasks like grouping data for analysis or showing items in a user interface. Python provides various simple methods to do this. In order to work with smaller data sets without losing any information, this article will show you how to split a list into uniformly sized chunks. What is List? List is one of the frequently ...

Read More

How to index and slice a tuple in Python?

Pranav Indukuri
Pranav Indukuri
Updated on 29-Aug-2023 37K+ Views

A tuple is an ordered and immutable collection of Python objects separated by commas. Like lists, tuples are sequences. Tuples differ from lists in that they can't be modified, whereas lists can, and they use parentheses instead of square brackets. tup=('tutorials', 'point', 2022, True) print(tup) If you execute the above snippet, produces the following output − ('tutorials', 'point', 2022, True) In this article, we will discuss how to index and slice tuples in python. Indexing Tuples In Python, every tuple with elements has a position or index. Each element of the tuple can be accessed or manipulated by ...

Read More

How does del operator work on list in Python?

Pranav Indukuri
Pranav Indukuri
Updated on 04-Apr-2023 950 Views

Lists are one of the four most commonly used data structures provided by Python. A list is a data structure in python that is mutable and has an ordered sequence of elements. Following is a list of integer values. lis= [1, 2, 3, 4, 5] print(lis) If you execute the above snippet, it produces the following output. [1, 2, 3, 4, 5] In this article, we will learn how a del operator works on a list in python. They are various scenarios where we use the del operator. The del operator The del keyword is mostly used in ...

Read More

How to convert pandas offset to Python date?

Pranav Indukuri
Pranav Indukuri
Updated on 07-Sep-2022 708 Views

In this article, we convert the pandas offset to date in python. When you subtract the pandas from a date object, you get a pandas Timestamp object. You can convert this object to a String format date or Date object(Standard Python date). Or you can use the timedelta object from the datetime library. Example 1 In the following example code, we remove the offset of 10 days using to_offset(“10D”) from the pandas pd.to_datetime(‘2018-01-04’). from pandas.tseries.frequencies import to_offset import pandas as pd dt = pd.to_datetime('2018-01-04') - to_offset("10D") print(type(dt)) print(dt) Output The output of the above code is as follows. ...

Read More

How do we compare Python Dates?

Pranav Indukuri
Pranav Indukuri
Updated on 05-Sep-2022 2K+ Views

In this article, we will understand how to compare python dates. They are different methods to identify which date is greater or lesser and these methods will be explored in detail. Using the timedelta() method and operator In this method, we use the datetime module and operator to compare two dates. To alter date and time, the datatime module provides timedelta() method. The timedelta() method takes the number of days as an input and returns the date. This method is used to perform arithmetic manipulations. Syntax The syntax of the timedelta() method from the datetime module in python ...

Read More
Showing 11–18 of 18 articles
« Prev 1 2 Next »
Advertisements