Programming Articles

Page 67 of 2547

Phrase extraction in String using Python

Vishal Gupta
Vishal Gupta
Updated on 27-Mar-2026 411 Views

Phrase extraction in Python is the process of identifying and extracting meaningful segments or phrases from text strings. This technique is commonly used in Natural Language Processing (NLP) applications for text analysis, information retrieval, and content summarization. Python provides several approaches to extract specific portions of text based on word positions or patterns. Let's explore two effective methods for phrase extraction. Using List Slicing and Enumerate This approach finds space positions in the string and extracts phrases based on these positions ? text = 'Website Tutorialspoint is best for reading Python and writing.' print("Original ...

Read More

Pendulum Module in Python

Vishal Gupta
Vishal Gupta
Updated on 27-Mar-2026 943 Views

The Pendulum Module is a powerful Python library for datetime manipulation and time zone management. It provides an intuitive API for handling dates, times, and timezone conversions more elegantly than Python's built-in datetime module. The Pendulum Module's main advantage is its ability to manage time zones easily. It can instantly convert between various time zones and handle dates and times from around the world. You can install this module using the following command ? pip install pendulum Key Methods in Pendulum Module The Pendulum module provides several essential methods for datetime operations ? ...

Read More

Show Pearson type-3 Distribution in Statistics using Python

Vishal Gupta
Vishal Gupta
Updated on 27-Mar-2026 597 Views

The Pearson Type-3 Distribution is a continuous probability distribution widely used in statistics, particularly for modeling skewed data. Three parameters determine its shape: shape, location, and scale. Python's SciPy library provides functions like pearson3.rvs() for generating random numbers and pearson3.pdf() for calculating probability density values. Parameters of Pearson Type-3 Distribution Shape parameter − Controls the skewness and kurtosis of the distribution. Positive values create right-skewed distributions, while negative values create left-skewed distributions. Location parameter − Shifts the distribution along the x-axis. This is the mean of the distribution when shape = 0. Scale parameter − Controls the ...

Read More

How to pass multiple arguments to a map function in Python?

Vishal Gupta
Vishal Gupta
Updated on 27-Mar-2026 2K+ Views

The map() function in Python applies a given function to each element of one or more iterables and returns an iterator. When working with multiple iterables, map() applies the function element-wise across all provided arguments. Syntax map(function, iterable1, iterable2, ...) The function must accept the same number of arguments as there are iterables provided. Using Multiple Arguments with Regular Function Example Let's create a program to add corresponding elements from two lists ? def add(a, b): return a + b # Create two lists list1 ...

Read More

How to Split a File into a List in Python?

Tushar Sharma
Tushar Sharma
Updated on 27-Mar-2026 490 Views

Python provides multiple ways to read a file and split its contents into a list. This is a common operation in data processing, text analysis, and file manipulation tasks. Understanding Files and Lists in Python In Python, a file is a named location on disk where data is stored permanently. Python can work with various file formats including text files (.txt), CSV files (.csv), and others. A list is a built-in data structure that can store multiple items in a single variable. Lists are mutable, meaning you can modify them after creation. Method 1: Using read() ...

Read More

How to Speedup Pandas with One-Line change using Modin?

Tushar Sharma
Tushar Sharma
Updated on 27-Mar-2026 246 Views

Data is considered the new oil in this information era. Python, with its extensive libraries, is one of the leading programming languages for data analysis, and Pandas is its crown jewel. However, as datasets have grown larger, Pandas users have found their workflows hampered by slow execution on large datasets. Fortunately, there's a way to vastly improve Pandas performance using a single line of code with Modin. What is Modin? Pandas excels in delivering high-performance, user-friendly data structures and tools for data analysis. However, it has one significant limitation — it was built to leverage single-core processing, which ...

Read More

How to speed up Pandas with cuDF?

Tushar Sharma
Tushar Sharma
Updated on 27-Mar-2026 422 Views

When working with large datasets in Python, Pandas can become slow due to CPU limitations. cuDF is a GPU-accelerated DataFrame library from NVIDIA's RAPIDS ecosystem that provides the same API as Pandas but with dramatically improved performance through parallel GPU processing. Installation Before using cuDF, install it using conda. Note that cuDF requires an NVIDIA GPU and CUDA toolkit ? conda install -c nvidia -c rapidsai -c numba -c conda-forge -c defaults cudf For detailed installation instructions and system requirements, visit the official RAPIDS documentation. Converting Pandas DataFrame to cuDF Let's create ...

Read More

10 Python File System Methods You Should Know

Tushar Sharma
Tushar Sharma
Updated on 27-Mar-2026 443 Views

Working with the file system is a common task in programming, and Python provides a rich collection of tools to interact with files and directories. In this article, we'll explore ten essential Python file system methods that you should know to streamline your coding projects. We'll walk through each method with practical examples. Opening and Closing Files The most basic file operation is opening a file for reading or writing ? # Create a sample file first with open('example.txt', 'w') as f: f.write('Hello, World!') # Now open and read it file ...

Read More

10 Python Code Snippets For Everyday Programming Problems

Tushar Sharma
Tushar Sharma
Updated on 27-Mar-2026 1K+ Views

Python has become one of the most popular programming languages worldwide, thanks to its simplicity, readability, and extensive libraries. Whether you're a beginner or an experienced developer, having a collection of useful code snippets can save you significant time and effort. In this article, we'll explore ten Python code snippets that solve common programming problems encountered in everyday development. Swapping Two Variables Swapping the values of two variables is a frequent task in programming. Python provides an elegant solution without needing a temporary variable ? a = 5 b = 10 print(f"Before swap: a = {a}, ...

Read More

1/4 Mile Calculator using PyQt5 in Python

Sarika Singh
Sarika Singh
Updated on 27-Mar-2026 266 Views

A 1/4 mile calculator helps estimate how long it takes for a vehicle to cover a quarter-mile (about 400 meters) based on its power and weight. This is commonly used in drag racing to measure a car's acceleration and performance. What Is a 1/4 Mile Calculator? To make this estimation, we use the following basic formula ? ET = (weight / horsepower) ** (1/3) * 5.825 In this formula: ET stands for Estimated Time in seconds Weight is the car's weight in pounds Horsepower is the engine power in HP ...

Read More
Showing 661–670 of 25,466 articles
« Prev 1 65 66 67 68 69 2547 Next »
Advertisements