Server Side Programming Articles

Page 68 of 2109

Exploring Data Distribution

Mithilesh Pradhan
Mithilesh Pradhan
Updated on 27-Mar-2026 740 Views

Data distribution analysis is a fundamental aspect of exploratory data analysis in data science and machine learning. Understanding how your data is distributed helps identify patterns, outliers, central tendencies, and the overall shape of your dataset. Python provides several powerful visualization tools to explore data distributions effectively. Histograms and Density Plots Histograms are the most popular graphical method for exploring data distribution. They use rectangular bars to represent the frequency of values within specific intervals called bins. A KDE (Kernel Density Estimation) plot shows the probability density function as a smooth curve. Basic Histogram Example ...

Read More

How to check the execution time of Python script?

Niharika Aitam
Niharika Aitam
Updated on 27-Mar-2026 13K+ Views

Measuring execution time is crucial for optimizing Python scripts and identifying performance bottlenecks. Python provides several built-in modules like time, timeit, and cProfile to measure how long your code takes to run. Using the time Module The time module provides a simple way to measure execution time by recording start and end timestamps. The time() function returns the current time in seconds since the Unix epoch ? Example import time # Record start time start_time = time.time() # Code to measure numbers = [] for i in range(100000): numbers.append(i ...

Read More

How to check multiple variables against a value in Python?

Niharika Aitam
Niharika Aitam
Updated on 27-Mar-2026 4K+ Views

When working with multiple variables in Python, you often need to check if they match certain values or conditions. Python provides several approaches to efficiently compare multiple variables against values using logical operators, built-in functions, and data structures. Using Logical 'and' and 'or' Operators The most straightforward approach uses logical operators. The and operator requires all conditions to be true, while or requires at least one condition to be true. Using 'and' Operator Check if all variables equal specific values ? x = 10 y = 20 z = 30 if x == ...

Read More

How to Check Loading Time of Website using Python

Niharika Aitam
Niharika Aitam
Updated on 27-Mar-2026 925 Views

Website loading time is a crucial performance metric. In Python, we can measure how long a website takes to respond by recording timestamps before and after making an HTTP request. This involves using the requests module for web requests and the time module for timing measurements. Basic Approach The concept is simple: record the time before making a request, send the request, then calculate the difference. Here's the basic implementation ? import requests import time url = "https://www.tutorialspoint.com" start_time = time.time() response = requests.get(url) end_time = time.time() loading_time = end_time - start_time print(f"Loading time ...

Read More

How to check if Time Series Data is Stationary with Python?

Niharika Aitam
Niharika Aitam
Updated on 27-Mar-2026 591 Views

Time series data is a collection of data points recorded at regular intervals. To make accurate forecasts, it's essential to check if the data is stationary – meaning its statistical properties don't change over time. Python provides several methods to test stationarity. What is Stationarity? A time series is stationary if its mean, variance, and autocorrelation remain constant over time. Non-stationary data shows trends, seasonality, or changing variance that can mislead forecasting models. Augmented Dickey-Fuller (ADF) Test The ADF test checks for unit roots in time series data. It tests the null hypothesis that the data ...

Read More

How to Check if Tensorflow is Using GPU?

Niharika Aitam
Niharika Aitam
Updated on 27-Mar-2026 842 Views

GPU is abbreviated as Graphics Processing Unit. It is a specialized processor designed to handle the complex and repetitive calculations required for video encoding or decoding, graphics rendering and other computational intensive tasks. It is mainly suited to perform large-scale parallel computations, which makes it ideal for machine learning and other data-based applications. GPUs in machine learning have become more popular as they reduce the time required to train complex neural networks. TensorFlow, PyTorch, and Keras are built-in frameworks of machine learning which support GPU acceleration. The following are the steps to check if TensorFlow is using ...

Read More

How to Check If Python Package Is Installed?

Niharika Aitam
Niharika Aitam
Updated on 27-Mar-2026 4K+ Views

In Python, we often need to check if a package is installed before using it in our programs. Python provides several built-in methods to verify package installation in your environment. A package is a directory containing one or more Python modules with an __init__.py file. Packages allow developers to create reusable code that can be imported into other programs, avoiding code duplication. Using try-except The most straightforward approach is to use a try-except block. When Python attempts to import an uninstalled package, it raises an ImportError exception. Example Here's how to check if a package ...

Read More

How to check if Pandas column has value from list of string?

Niharika Aitam
Niharika Aitam
Updated on 27-Mar-2026 2K+ Views

In pandas, we often need to check if values in a DataFrame column match any items from a given list of strings. This is useful for filtering data, data validation, or finding specific patterns in your dataset. Pandas is a powerful Python library for data analysis and manipulation. It provides several methods to check if column values exist in a list of strings, with isin() being the most commonly used approach. Creating Sample Data Let's first create a sample DataFrame to demonstrate different methods ? import pandas as pd data = { ...

Read More

How to check if an object is iterable in Python?

Niharika Aitam
Niharika Aitam
Updated on 27-Mar-2026 1K+ Views

An iterable object is any object that can be iterated through all its elements using a loop or iterable function. Lists, strings, dictionaries, tuples, and sets are all iterable objects in Python. There are several reliable methods to check if an object is iterable. Let's explore the most effective approaches. Using try-except with iter() The most Pythonic way is to use iter() function inside a try-except block. This approach follows the "easier to ask for forgiveness than permission" (EAFP) principle ? # Check if a list is iterable data = ["apple", 22, "orange", 34, "abc", ...

Read More

How to check if an application is open in Python?

Niharika Aitam
Niharika Aitam
Updated on 27-Mar-2026 6K+ Views

A process is a program under execution. When an application runs on your operating system, it creates one or more processes. Python provides several methods to check if a specific application is currently running on your system. We'll explore three different approaches to check if an application is open: using the psutil module, the subprocess module, and the wmi module for Windows systems. Using psutil.process_iter() Function The psutil module provides a cross-platform interface for retrieving information about running processes and system utilization. It works on Linux, Windows, macOS, Solaris, and AIX. First, install psutil using ? ...

Read More
Showing 671–680 of 21,090 articles
« Prev 1 66 67 68 69 70 2109 Next »
Advertisements