Server Side Programming Articles

Page 74 of 2109

How to count the number of instances of a class in Python?

Mukul Latiyan
Mukul Latiyan
Updated on 27-Mar-2026 6K+ Views

In Python, counting the number of instances of a class is a common task that can be accomplished using various techniques. One straightforward approach is to use a class variable to keep track of the number of instances created. To implement this method, you can define a class variable, such as count, and increment it each time a new instance of the class is created. This variable can be accessed from both the class and its instances, allowing you to easily retrieve the total number of instances created. Another approach is to use the built-in function len() along ...

Read More

How to Correctly Access Elements in a 3D Pytorch Tensor?

Mukul Latiyan
Mukul Latiyan
Updated on 27-Mar-2026 1K+ Views

PyTorch is a popular open-source machine learning framework that provides efficient tensor operations on both CPUs and GPUs. A tensor is a multi-dimensional array in PyTorch, and it is the fundamental data structure used for storing and manipulating data in PyTorch. In this context, a 3D tensor is a tensor with three dimensions, and it can be represented as a cube-like structure with rows, columns, and depth. To access elements in a 3D PyTorch tensor, you need to know its dimensions and the indices of the elements you want to access. The indices of a tensor are specified ...

Read More

How to Convert Unstructured Data to Structured Data Using Python ?

Mukul Latiyan
Mukul Latiyan
Updated on 27-Mar-2026 2K+ Views

Unstructured data is data that does not follow any specific data model or format, and it can come in different forms such as text, images, audio, and video. Converting unstructured data to structured data is an important task in data analysis, as structured data is easier to analyse and extract insights from. Python provides various libraries and tools for converting unstructured data to structured data, making it more manageable and easier to analyse. In this article, we will explore how to convert unstructured data into a structured format using Python, allowing for more meaningful analysis and interpretation of the ...

Read More

How to Convert to Best Data Types Automatically in Pandas?

Mukul Latiyan
Mukul Latiyan
Updated on 27-Mar-2026 2K+ Views

Pandas is a popular data manipulation library in Python used for cleaning and transforming data. When working with datasets, columns often have suboptimal data types that can impact performance and memory usage. Pandas provides the convert_dtypes() method to automatically convert columns to their best−suited data types based on the actual data values. This automatic conversion feature eliminates manual type checking and ensures optimal data formatting without the tedious process of examining each column individually. Using convert_dtypes() for Automatic Conversion The convert_dtypes() method analyzes column data and selects the most appropriate data type automatically ? import ...

Read More

Modelling Steady Flow Energy Equation in Python

Dr Pankaj Dumka
Dr Pankaj Dumka
Updated on 27-Mar-2026 384 Views

The Steady Flow Energy Equation (SFEE) applies conservation of energy to open systems where fluid flows continuously through a control volume. This equation is fundamental in analyzing turbomachines, nozzles, diffusers, and other fluid flow devices. Control Volume Inlet (i) p_i, V_i, h_i, z_i Exit (e) p_e, V_e, h_e, z_e Q̇ ...

Read More

Introduction to NSE Tools Module in Python

Mayukh Sen
Mayukh Sen
Updated on 27-Mar-2026 1K+ Views

The NSE (National Stock Exchange of India Limited) is India's leading stock exchange, established in 1992 as the country's first dematerialized exchange. Python's nsetools library provides easy access to NSE data for real-time stock market analysis. What is NSE Tools Module? The nsetools library is a Python package that allows developers to fetch live stock market data from the National Stock Exchange. It provides real-time quotes, stock prices, indices, and market statistics without requiring complex API authentication. Key Features Works instantly without complex setup requirements Provides real-time data from NSE at high speed Covers all ...

Read More

Finding Words Lengths in String using Python

Aayush Shukla
Aayush Shukla
Updated on 27-Mar-2026 4K+ Views

Finding the lengths of individual words in a string is a common task in text processing and data analysis. Python provides several approaches to accomplish this, from simple loops to more advanced techniques using regular expressions and dictionaries. Methods Used Using a loop and the split() function Using the map() function with len and split() Using the re.split() method from the re module Using a Dictionary to store word lengths Using a Loop and the split() Function This is the most straightforward ...

Read More

Change Value in Excel Using Python

Mukul Latiyan
Mukul Latiyan
Updated on 27-Mar-2026 5K+ Views

In this article, we will learn different approaches to change values in Excel files using Python. We'll explore two main libraries: openpyxl for modern Excel formats and xlwt/xlrd/xlutils for legacy formats. Using Openpyxl Openpyxl is a Python library designed for working with Excel spreadsheets. It supports modern Excel file formats including: XLSX (Microsoft Excel Open XML Spreadsheet) XLSM (Microsoft Excel Open XML Macro−Enabled Spreadsheet) XLTM (Microsoft Excel Open XML Macro−Enabled Template) XLTX (Microsoft Excel Open XML Template) Key Features Reading and Writing: Create, modify, and save Excel files Data Manipulation: Sort, filter, ...

Read More

Cluster Sampling in Pandas

Mukul Latiyan
Mukul Latiyan
Updated on 27-Mar-2026 894 Views

In this article, we will learn how we can perform cluster sampling in Pandas. But before we deep dive into that, let's explore what sampling is in Pandas and how it helps us analyze data efficiently. Sampling in Pandas In Pandas, sampling refers to the process of selecting a subset of rows or columns from a DataFrame or Series object. Sampling can be useful in many data analysis tasks, such as data exploration, testing, and validation. Pandas provides several methods for sampling data, including: DataFrame.sample(): This method returns a random sample of rows from a ...

Read More

Clear LRU Cache in Python

Mukul Latiyan
Mukul Latiyan
Updated on 27-Mar-2026 13K+ Views

In this article, we will learn how to clear an LRU cache implemented in Python. LRU Cache (Least Recently Used Cache) is a data structure that improves application performance by storing frequently-used data and removing the least recently used items when the cache becomes full. The LRU Cache is particularly useful in applications with high-cost data retrieval operations, such as disk I/O or network access. By caching frequently-used data in memory, applications can significantly reduce expensive operations and improve performance. Understanding LRU Cache in Python Python's functools module provides the @lru_cache decorator to implement LRU caching. This ...

Read More
Showing 731–740 of 21,090 articles
« Prev 1 72 73 74 75 76 2109 Next »
Advertisements