Found 27104 Articles for Server Side Programming

Change Value in Excel Using Python

Mukul Latiyan
Updated on 02-Aug-2023 17:42:45

3K+ Views

In this article we will learn different approaches with which we can change the value of data present in an excel sheet using python. Openxypl Openpyxl is a Python library used for working with Excel spreadsheets. It is a popular choice for working with Excel files in Python because it is easy to use, has an active developer community, and provides many features for working with spreadsheets. Openpyxl allows you to create, read, write, and modify Excel files using Python. It supports the following file formats: XLSX (Microsoft Excel Open XML Spreadsheet) XLSM (Microsoft Excel Open XML Macro−Enabled ... Read More

Image Data Processing in Python Using Keras, TensorFlow and Pillow

Mukul Latiyan
Updated on 02-Aug-2023 17:33:59

266 Views

Image data pre−processing is an essential step in training deep learning models that take images as input. In large−scale image datasets, pre−processing images can be computationally expensive and can result in high memory consumption. To address this issue, generators are often used to pre−process and feed images into a deep learning model. In Python, the Keras library provides a powerful tool for pre−processing image data using generators. The ImageDataGenerator class can be used to create a generator that reads images from a specified directory and performs pre−processing operations on the fly. The ImageDataGenerator class provides several methods for performing pre−processing ... Read More

Cluster Sampling in Pandas

Mukul Latiyan
Updated on 02-Aug-2023 17:30:54

443 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 a little about what sampling is in Pandas, as well as how pandas help us to do that. Sampling 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
Updated on 02-Aug-2023 17:28:22

7K+ Views

In this article, we will learn how to clear an LRU cache implemented in Python. Before we dive deep into the coding aspect, let's explore a little about what an LRU cache is and why it is popular. LRU Cache, also known as the Least Recently Used Cache, is a data structure that is widely used in computer science to improve the performance of applications by reducing the time it takes to access frequently−used data. The LRU Cache stores a limited number of items and removes the least recently used item when the cache becomes full. This allows ... Read More

Check if a Thread has Started in Python

Mukul Latiyan
Updated on 02-Aug-2023 17:24:04

4K+ Views

Multithreading is a powerful technique used in modern programming languages to execute multiple threads simultaneously. In Python, the threading module is used to implement multithreading. Multithreading allows programs to perform multiple tasks at once and can improve the performance of applications. When working with multithreading in Python, it's essential to know how to check if a thread is running or not. The is_alive() method provided by the Thread class is a simple and effective way to check the status of a thread. By using this method, you can determine whether a thread has started, is running, or has finished its ... Read More

Check if a String is Present in a Pdf File in Python

Mukul Latiyan
Updated on 02-Aug-2023 17:19:55

386 Views

In today's digital world, PDF files have become an essential medium for storing and sharing information. However, sometimes it can be difficult to find a specific string of text within a PDF document, especially if the file is lengthy or complex. This is where Python, a popular programming language, comes in handy. Python provides several libraries that allow us to interact with PDF files and extract information from them. One common task is to search for a particular string within a PDF file. This can be useful for various purposes, such as data analysis, text mining, or information retrieval. In ... Read More

Check if a Column Starts/Ends with a given String in Pandas DataFrame

Mukul Latiyan
Updated on 02-Aug-2023 17:00:06

2K+ Views

Pandas is a popular Python library used for data manipulation and analysis. It provides powerful tools for working with structured data, such as tables or spreadsheets. Pandas can handle a variety of data formats, including CSV, Excel, SQL databases, and JSON, among others. One of the critical features of Pandas is its two primary data structures: Series and DataFrame. A Series is a one−dimensional array−like object that can hold any data type, such as integers, floating−point numbers, strings, or even Python objects. Series are labelled, meaning that they have an index that is used to access and manipulate the data. ... Read More

Change the View of Tensor in PyTorch

Mukul Latiyan
Updated on 02-Aug-2023 16:23:59

75 Views

PyTorch is an open−source machine learning library developed by Facebook's AI Research team. It is primarily used for deep learning applications, including natural language processing, computer vision, and reinforcement learning. PyTorch provides two main features: a multidimensional Tensor object and a collection of functions that operate on these Tensors. Torch The Tensor object in PyTorch is similar to NumPy's ndarray, but with added capabilities for utilizing GPUs and building dynamic computational graphs. These computational graphs are constructed on−the−fly during the execution of the program, allowing for efficient memory usage and more flexible model architectures. Additionally, PyTorch has a modular design ... Read More

CMY and CMYK Color Models using Python

Niharika Aitam
Updated on 02-Aug-2023 17:38:23

987 Views

The CMY and CMYK color models are subtractive color models used in printing and graphic design. In Python, we can work with these color models using various libraries and tools. Let's see each color model in detail. CMY color model The CMY color model, also known as the subtractive color model, which is a system used for mixing colors in various applications like printing, painting, and graphic design. CMY stands for Cyan, Magenta, and Yellow, which are the primary colors in this model. In the CMY color model, colors are created by subtracting different amounts of cyan, magenta, and yellow ... Read More

Python - Check if a string matches regex list

Niharika Aitam
Updated on 02-Aug-2023 17:37:34

8K+ Views

A regular expression is also referred as regex, which is a sequence of characters that forms a search pattern. It's one of the powerful tools used for pattern matching and manipulating strings. In python we are having a module called re which helps to form a regular expression. Regex patterns consist of ordinary characters such as letters, digits and special characters called metacharacters. Meta Characters have special meanings and allow us to define complex search patterns. The below are some commonly used meta characters in python regular expressions. . (dot) − Matches any single character except a newline. ^ ... Read More

Advertisements