Programming Articles

Page 33 of 2547

How to merge multiple folders into one folder using Python?

Tarun Singh
Tarun Singh
Updated on 27-Mar-2026 3K+ Views

Data in today's time is generated in large volumes, and organizing that data can be a challenging task. One of the most common issues people face is merging multiple folders into one. It can be quite frustrating to search for a specific file when you have multiple folders to navigate through. Fortunately, Python provides a simple solution to this problem. In this article, we will learn how to merge multiple folders into one folder using Python. To merge multiple folders into one, we will be using the os and shutil modules that provide a portable way of using operating ...

Read More

How to merge multiple excel files into a single file with Python?

Tarun Singh
Tarun Singh
Updated on 27-Mar-2026 12K+ Views

Excel is one of the most popular tools for data analysis and management. Often, we need to merge multiple Excel files into a single file for analysis or sharing with others. Manually merging these files can be time−consuming and prone to errors, especially when dealing with large datasets. Luckily, Python provides an efficient and flexible way to merge multiple Excel files into a single file. In this article, we will learn how to merge multiple Excel files using Python. We will be using the Pandas library, which is a powerful and easy−to−use data analysis library for Python to merge ...

Read More

How to merge many TSV files by common key using Python Pandas?

Tarun Singh
Tarun Singh
Updated on 27-Mar-2026 824 Views

If you work with data, you've probably had to deal with the challenge of merging multiple files into one cohesive dataset. This task can be particularly difficult if you're working with tab-separated values (TSV) files. Fortunately, the Python Pandas library provides a straightforward solution for merging TSV files by a common key. In this article, we'll learn how to merge multiple TSV files using Python Pandas. We'll explore different merging techniques including merge() for joining by common keys and concat() for combining files with identical structures. What are TSV Files? TSV files are a type of delimited ...

Read More

How to merge a transparent PNG image with another image using PIL?

Tarun Singh
Tarun Singh
Updated on 27-Mar-2026 2K+ Views

In image processing, merging a transparent PNG image with another image is a common operation. This creates composite images where the transparent PNG overlays seamlessly on top of a background image. In this article, we will learn how to merge a transparent PNG image with another image using PIL (Python Imaging Library). PIL is a powerful library for working with images in Python, supporting various formats including JPEG, PNG, BMP, GIF, and TIFF. Basic Steps for Image Merging To merge a transparent PNG image with another image using PIL, we need to follow these steps − ...

Read More

Multiplying Alternate elements in a List using Python?

Adeeba Khan
Adeeba Khan
Updated on 27-Mar-2026 244 Views

Multiplying alternate elements in a list is a common array manipulation task in Python programming. This involves selecting elements at even indices (0, 2, 4, ...) and calculating their product. We'll explore two approaches: iterative method and list comprehension. Arrays are fundamental data structures for storing collections of elements. Python provides powerful tools for array manipulation, and by solving the alternate element multiplication problem, we'll demonstrate elegant programming techniques. Using Iterative Approach The iterative approach uses a loop to traverse the list and multiply elements at even indices. We initialize a result variable to 1, then iterate ...

Read More

Python Program for Convert characters of a string to opposite case

Shubham Vora
Shubham Vora
Updated on 27-Mar-2026 641 Views

In this problem, we will toggle the case of each string character. The easiest way to toggle the case of each string character is using the swapcase() built-in method. Also, we can use the ASCII values of the characters to swap their case. Python also contains isupper() and islower() methods to check the character's case and the lower() and upper() methods to change the case. Problem statement − We have given a string. We need to toggle the case of string characters. It means converting uppercase characters to lowercase and lowercase characters to uppercase. Sample Examples ...

Read More

How To Add Color Breezing Effect Using Pygame?

Shashank Dharasurkar
Shashank Dharasurkar
Updated on 27-Mar-2026 345 Views

Pygame is a popular Python library for 2D game development that provides comprehensive functions for graphics, sound, and input handling. One visually appealing effect you can create is a color breathing effect, where objects pulsate with changing colors and opacity, creating a dynamic "breathing" animation. What is a Color Breathing Effect? A breathing effect combines color manipulation with scaling to create objects that appear to "breathe" by: Gradually changing the object's transparency (alpha value) Scaling the object size up and down Using sine wave calculations for smooth transitions Complete Implementation Here's a complete ...

Read More

How to Add A Color Picker In Bokeh?

Shashank Dharasurkar
Shashank Dharasurkar
Updated on 27-Mar-2026 343 Views

Bokeh is one of the most underrated Python visualization libraries and can be used for various applications, including data analysis, scientific visualization, interactive dashboards, etc. In this article, we will learn how to add a color picker widget in Bokeh. What's A Color Picker? A color picker is one of the many widgets present in Bokeh. It helps the user to specify an RGB color value. Widgets add interactions to the graphs, which can then help users to update plots or drive new computations without diving into code. Besides the color picker, Bokeh has many interesting widgets like ...

Read More

Union of Python Tuples

Pranay Arora
Pranay Arora
Updated on 27-Mar-2026 1K+ Views

A tuple is a sequential, immutable data structure in Python consisting of multiple values. Since tuples are immutable, finding their union requires creative approaches using mutable data structures like sets. The union operation combines elements from multiple tuples while removing duplicates. The union of Python tuples finds applications in removing duplicates, merging data sources, set operations, data deduplication, merging multiple results, database operations, handling data overlaps, and set operations in machine learning. Using Set and '+' Operator Convert tuples to a set after concatenation. Sets automatically remove duplicate elements ? # Taking two tuples tuple1 ...

Read More

Python - Type conversion in Nested and Mixed List

Pranay Arora
Pranay Arora
Updated on 27-Mar-2026 692 Views

Python lists are heterogeneous and can contain nested structures, making type conversion a crucial skill. When working with nested lists (lists within lists) or mixed lists (containing different data types), we need special techniques to convert elements while preserving the original structure. In this article, we will explore three effective methods for type conversion in nested and mixed lists using list comprehension, recursion, and the map() function. Understanding Nested and Mixed Lists A nested list contains other lists as elements, creating a hierarchical structure. A mixed list contains elements of different data types like integers, strings, lists, ...

Read More
Showing 321–330 of 25,469 articles
« Prev 1 31 32 33 34 35 2547 Next »
Advertisements