SaiKrishna Tavva has Published 107 Articles

What are the modules available in Python for converting PDF to text?

SaiKrishna Tavva

SaiKrishna Tavva

Updated on 07-Jan-2025 11:24:38

329 Views

Python offers several powerful libraries to convert PDF documents to plain text, such as PyPDF2 and PDFMiner which are two popular modules for text extraction from PDFs. Some of the common approaches (modules) for converting PDF to text are as follows- Using PyPDF2 ... Read More

How to insert a Python object in Mongodb?

SaiKrishna Tavva

SaiKrishna Tavva

Updated on 18-Dec-2024 19:23:27

811 Views

By using pymongo library, we can insert a Python object into MongoDB, which is a widely used MongoDB driver for Python. To insert a Python object represented as a dictionary, we have to establish the setup for a MongoDB client and connect to a database and collection. Before starting, ensure ... Read More

Python Sequence Types

SaiKrishna Tavva

SaiKrishna Tavva

Updated on 18-Dec-2024 19:22:23

10K+ Views

In Python programming, some basic sequence type classes are, Lists , Strings , Tuples, Range, etc, these data structures hold an ordered collection of items. They allow us to access their elements through indexing and iteration, there are additional sequence-type objects such as Byte sequences. Sequence Types In Python Sequence ... Read More

Generate all permutation of a set in Python?

SaiKrishna Tavva

SaiKrishna Tavva

Updated on 17-Dec-2024 13:06:16

5K+ Views

Permutations refer to arranging the members of a set into different sequences. if the set is already ordered, rearranging (reordering) its elements. If a set has n elements, the total number of permutations is n! (factorial of n) Some common approaches we can use to generate all permutations of a ... Read More

Data Classes in Python (dataclasses)

SaiKrishna Tavva

SaiKrishna Tavva

Updated on 17-Dec-2024 12:51:42

806 Views

In Python, the dataclasses module simplifies the creation of classes primarily used to store data. By using the @dataclass decorator, developers can automatically generate special methods such as __init__(), __repr__(), and __eq__(), which reduces boilerplate code and improves readability. Overview of dataclass Decorator The dataclass decorator has the following syntax: ... Read More

Find Peak Element in Python

SaiKrishna Tavva

SaiKrishna Tavva

Updated on 12-Dec-2024 17:50:26

4K+ Views

A peak element in an array is defined as an element that is greater than its neighbors. We can use some common approaches such as binary search to efficiently locate a peak element and linear search algorithm which involves iterating through an array. Binary Search Approach The Binary Search is an ... Read More

Palindromic Substrings in Python

SaiKrishna Tavva

SaiKrishna Tavva

Updated on 12-Dec-2024 17:34:07

3K+ Views

In Python, finding palindromic substrings (sequences that read the same forwards and backwards) can be done using various methods, such as expanding from the centre and the brute force method etc. Some of the common approaches to finding palindromic substrings in Python are as follows: ... Read More

How to save a histogram plot in Python?

SaiKrishna Tavva

SaiKrishna Tavva

Updated on 12-Dec-2024 17:33:32

7K+ Views

When working with data visualization, plotting and saving a histogram on a local machine is a common task. This can be done using various functions provided by Python's Matplotlib, such as plt.savefig() and plt.hist(). The plt.hist is used function to create a histogram, by taking a list of data ... Read More

Python Program to Implement Binary Search without Recursion

SaiKrishna Tavva

SaiKrishna Tavva

Updated on 12-Dec-2024 17:32:55

5K+ Views

To implement binary search without recursion, the program takes a sorted list and a key as input. It uses the Binary search method, which is an efficient way to find a specific item in a sorted list. It works by repeatedly dividing the list in half. This method works by ... Read More

File Searching using Python

SaiKrishna Tavva

SaiKrishna Tavva

Updated on 20-Nov-2024 17:41:08

41K+ Views

File Searching in Python can be done using various methods, like using the os module with os.walk() function as it takes a specific path as input and generates a 3-tuple involving dirpath, dirnames, and filenames. Another method is using the pathlib module which provides an object-oriented interface while working on file ... Read More

Previous 1 ... 5 6 7 8 9 ... 11 Next
Advertisements