Articles on Trending Technologies

Technical articles with clear explanations and examples

How to set the tab size in Text widget in Tkinter?

Tapas Kumar Ghosh
Tapas Kumar Ghosh
Updated on 27-Mar-2026 1K+ Views

The Python Tkinter module provides a powerful way to create graphical user interfaces (GUIs). The Text widget is particularly useful for multi-line text input, and you can customize its tab size using the tabs parameter to improve text formatting and readability. Setting Tab Size in Text Widget The tabs parameter in the Text widget accepts a tuple or list of tab stop positions measured in pixels or other units ? import tkinter as tk # Create main window root = tk.Tk() root.title("Text Widget Tab Size") root.geometry("600x400") # Create Text widget with custom tab size ...

Read More

How to setup Conda environment with Jupyter Notebook?

Tapas Kumar Ghosh
Tapas Kumar Ghosh
Updated on 27-Mar-2026 551 Views

Jupyter Notebook is an open-source web application that allows you to create and share documents containing live code, equations, visualizations, and narrative text. Conda is a powerful package manager that helps you manage different Python environments and packages. Setting up a Conda environment with Jupyter Notebook provides an isolated workspace for your data science and machine learning projects. Benefits of Using Conda with Jupyter Notebook Create isolated environments for different projects with specific package versions Easy installation and management of data science packages like NumPy, Pandas, and Matplotlib Avoid package conflicts between different projects Simple environment sharing ...

Read More

Get Random Range Average using Python

Rohan Singh
Rohan Singh
Updated on 27-Mar-2026 899 Views

Python provides several methods to generate random numbers within a specific range and calculate their average. This article explores four different approaches using the random module, NumPy library, random.choices() function, and statistics module. Algorithm The general algorithm to generate random numbers and find their average is: Generate random numbers within a specified range Store these numbers in a list or array Calculate the average of the generated numbers Display the result Method 1: Using the Random Module The random module provides a simple way to generate random numbers. We can use random.randint(a, b) ...

Read More

How to set alignment of each dropdown widget in Jupyter?

Tapas Kumar Ghosh
Tapas Kumar Ghosh
Updated on 27-Mar-2026 643 Views

Dropdown widgets in Jupyter notebooks can be aligned using CSS layout properties and the ipywidgets package. We can control alignment using the Layout() class to position dropdowns side by side, center them, or arrange them vertically for better visual presentation. Installation Requirements Install the required packages ? pip install ipywidgets ipyvuetify Basic Syntax The main components for creating aligned dropdown widgets ? # Create dropdown widget widgets.Dropdown(options=[], description='', layout=widgets.Layout()) # Define layout alignment widgets.Layout(width='70%', align_self='center') # Alternative using ipyvuetify v.Select(multiple=True, items=[], label='', style_='width:300px') Key Parameters ...

Read More

Ledoit-Wolf vs OAS Estimation in Scikit Learn

Siva Sai
Siva Sai
Updated on 27-Mar-2026 488 Views

Understanding various techniques for estimating covariance matrices is essential in machine learning. Scikit-Learn provides two popular shrinkage-based covariance estimation methods: Ledoit-Wolf and Oracle Approximating Shrinkage (OAS). Both methods address the challenge of unreliable empirical covariance estimation in high-dimensional scenarios. Introduction to Covariance Estimation Covariance estimation quantifies relationships between multiple dimensions or features in datasets. In high-dimensional data where features outnumber samples, the standard empirical covariance matrix becomes unreliable. Shrinkage methods like Ledoit-Wolf and OAS provide more robust estimates by "shrinking" the empirical matrix toward a structured target. Ledoit-Wolf Estimation The Ledoit-Wolf method shrinks the empirical covariance ...

Read More

How to search a value within a Pandas DataFrame row?

Tapas Kumar Ghosh
Tapas Kumar Ghosh
Updated on 27-Mar-2026 4K+ Views

Pandas DataFrame is a two-dimensional data structure that represents data in tabular form with rows and columns. Python provides several built-in methods like eq(), any(), loc[], and apply() to search for specific values within DataFrame rows. Basic Value Search in a Column The simplest approach is to search for a value in a specific column using boolean indexing ? import pandas as pd # Create a DataFrame data = {'Name': ['Bhavish', 'Abhinabh', 'Siddhu'], 'Age': [25, 32, 28]} df = pd.DataFrame(data) # Search for a value in ...

Read More

Lazy import in Python

Siva Sai
Siva Sai
Updated on 27-Mar-2026 5K+ Views

Lazy import in Python is a technique where modules are imported only when they're actually needed, rather than at the start of the program. This approach can significantly improve startup times and reduce memory usage, especially for applications with heavy dependencies. What is Lazy Import? Traditionally, Python imports modules at the beginning of a script using import statements. However, importing large libraries can slow down startup times and consume unnecessary memory if those modules aren't immediately used. Lazy import delays the importing process until the module is actually required in your code. This technique is also known ...

Read More

How to sort by value in PySpark?

Tapas Kumar Ghosh
Tapas Kumar Ghosh
Updated on 27-Mar-2026 925 Views

PySpark is a distributed data processing engine that provides Python APIs for Apache Spark. It enables large-scale data processing and offers several built-in functions for sorting data including orderBy(), sort(), sortBy(), and asc_nulls_last(). Installation First, install PySpark using pip ? pip install pyspark Key Sorting Functions Function Usage Best For orderBy() DataFrame column sorting Single/multiple columns with custom order sort() DataFrame sorting with functions Descending order and null handling sortBy() RDD sorting with lambda Custom sorting logic on RDDs Sorting DataFrame by ...

Read More

Launching AWS EC2 Instance using Python

Siva Sai
Siva Sai
Updated on 27-Mar-2026 541 Views

The need for engineers skilled in cloud services like Amazon Web Services (AWS) has increased as more companies around the world move their operations to the cloud. One of the most well-known services offered by AWS, EC2 (Elastic Compute Cloud), offers scalable computing capability. Python is frequently used to manage AWS resources, including launching EC2 instances, due to its vast ecosystem and ease of use. This article will show you how to use Python to launch an AWS EC2 instance with practical examples. Understanding AWS EC2 and Python Boto3 AWS EC2 provides resizable computational capacity in the cloud. ...

Read More

How to Skip every Nth index of Numpy array?

Tapas Kumar Ghosh
Tapas Kumar Ghosh
Updated on 27-Mar-2026 2K+ Views

In NumPy arrays, you can skip every Nth index using several approaches: modulus operations with np.mod(), array slicing, or loop-based filtering. These techniques are useful for data sampling, filtering, and array manipulation tasks. Understanding the Modulus Approach The modulus approach uses np.mod() to identify which indices to skip. It works by calculating the remainder when dividing each index by N, then filtering elements where the remainder is not zero. import numpy as np # Create a sample array x = np.array([10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140]) ...

Read More
Showing 1–10 of 61,303 articles
« Prev 1 2 3 4 5 6131 Next »
Advertisements