Python Articles

Page 3 of 855

How to install Python in Ubuntu?

Abhishek Nair
Abhishek Nair
Updated on 27-Mar-2026 505 Views

Python is a powerful, open-source and easy to learn programming language. It is one of the most popular modern programming languages with a huge community of developers and extensive documentation. Python usually comes pre-installed on all latest Linux systems as it is one of the building blocks of many operating system tools. However, based on user requirements, you can install specific versions of Python from available sources. In this tutorial, we will show you two ways to install Python on an Ubuntu system: Installing Python using package manager (apt) Installing Python using its source code ...

Read More

What is COCOTB and How Does It Revolutionize Hardware Verification?

Moksh Gupta
Moksh Gupta
Updated on 27-Mar-2026 658 Views

Verification in the world of digital hardware design is a crucial step for ensuring correctness and reliability of hardware components prior to fabrication. Traditional methods of verification usually rely on hardware description languages (HDLs), like Verilog or VHDL, together with specialized verification languages and frameworks. However, these approaches can be cumbersome and impact productivity. Here comes Cocotb, a revolutionary approach that combines the power of Python for writing hardware verification testbenches in a completely new way. What is Cocotb? Cocotb (COroutine based COsimulation TestBench) is a free, open-source framework that allows engineers to write testbenches in Python ...

Read More

Visualising Forex data using Python

naga chitrika
naga chitrika
Updated on 27-Mar-2026 491 Views

Historical forex data is crucial for identifying trends, assessing past performance, and making informed predictions in currency markets. Visualizing this data enhances analysis by clearly displaying price movements and patterns, aiding in better decision-making for traders and analysts. This tutorial will guide you through retrieving historical currency data using the TraderMade API and visualizing it in a candlestick chart format with Plotly. Candlestick charts are popular in financial analysis because they provide a clear view of price movements, including open, high, low, and close prices for a specific period. We will use the EUR/USD currency pair data over a ...

Read More

Difference between Stack and Tree

guru
guru
Updated on 27-Mar-2026 439 Views

Data structures are essential components in computer science and software engineering. Among the most commonly used are stacks and trees, both of which play a crucial role in different algorithms and systems. Though both stack and tree are non-primitive data structures, they serve different purposes and operate on distinct principles. This article will explore the key differences between stack and tree, their structures, operations, use cases and examples. What is a Stack? A stack is a linear data structure that follows the Last In, First Out (LIFO) principle. This means that the last element added to the stack ...

Read More

Python Program for Mirror of matrix across diagonal

Tanya Sehgal
Tanya Sehgal
Updated on 27-Mar-2026 627 Views

The mirror of a matrix across a diagonal means swapping the elements at position[i, j] with the elements at position[j, i]. This operation is also known as finding the transpose of a matrix. Problem Statement You are given a 2-D matrix in Python in the form of a nested list, and you need to find the transpose, that is, the mirror of that matrix across the diagonal. Example Input: matrix = [[1, 2, 3], [4, 5, 6], [7, 8, 9]] Output: [[1, 4, 7], [2, 5, 8], [3, ...

Read More

Partitioning by multiple columns in PySpark with columns in a list

Abhijat Sarari
Abhijat Sarari
Updated on 27-Mar-2026 345 Views

When working with large datasets in PySpark, partitioning is a crucial technique for optimizing performance. This article explores how to partition data by multiple columns using a list, making data processing more efficient and scalable. What is Partitioning? Partitioning divides large datasets into smaller, manageable segments called "partitions." Instead of processing one massive file, PySpark can work on multiple smaller files simultaneously, significantly reducing processing time. Think of it like organizing a library — books are grouped by subject and author, making it faster to find what you need. Why Partition by Multiple Columns? Multi-column partitioning ...

Read More

How to Extract Fundamental Data from the S&P 500 with Python

micahgreen
micahgreen
Updated on 27-Mar-2026 801 Views

The S&P 500 index represents the benchmark performance of the 500 largest public companies in the US. Extracting fundamental data from these companies is essential for investors, analysts, and researchers to make informed investment decisions. Python provides powerful libraries that make it easy to extract and analyze financial data. This tutorial demonstrates how to extract fundamental data from S&P 500 companies using Python's yfinance and web scraping capabilities. Why Extract Fundamental Data? Fundamental data includes core financial information such as earnings, revenues, dividends, and valuation metrics that determine a company's financial strength. This data enables investors to ...

Read More

Applying Python programming to solve Mechanical Engineering Problems

Pankaj Dumka
Pankaj Dumka
Updated on 27-Mar-2026 677 Views

In closed systems where mass remains constant, the system interacts with surroundings through heat or work. This article focuses on PDV (pressure-displacement-volume) work using Python programming to solve mechanical engineering problems. Displacement work is evaluated as the integral of the path between end states in a pressure-volume plot. For accurate evaluation, the path must be completely specified through quasi-static processes. The area under the curve represents work done mathematically ? W = ∫ P dV where: W = Work done (kJ) P = Pressure (kPa) V = ...

Read More

Playing a Beep Sound in Python: winsound Module

Gaurav Leekha
Gaurav Leekha
Updated on 27-Mar-2026 4K+ Views

The Python winsound module is a simple way to play audio files and generate beep sounds on Windows machines. It provides a straightforward interface for playing sound files, generating system beeps, and working with MIDI devices using just a few lines of code. The winsound module is part of the Python standard library, so you don't need to install it separately. While it has some limitations such as only supporting a limited number of audio file formats and being Windows-specific, it can be a useful tool for simple audio tasks in Python. In this tutorial, we'll explore how ...

Read More

Choropleth maps using Plotly in Python

Gaurav Leekha
Gaurav Leekha
Updated on 27-Mar-2026 1K+ Views

A choropleth map is a map that displays data on geographic regions using different colors or shades to represent values. The data is usually represented as a color scale, with darker colors indicating higher values and lighter colors indicating lower values. Choropleth maps are useful for visualizing data on a map, such as demographic data, election results, or economic indicators. Plotly is a Python data visualization library that allows users to create interactive plots and charts. It offers a range of features for creating custom visualizations, including line charts, scatterplots, bar charts, and choropleth maps. In this tutorial, we ...

Read More
Showing 21–30 of 8,549 articles
« Prev 1 2 3 4 5 855 Next »
Advertisements