Programming Articles - Page 155 of 3366

Opening Links Using Selenium in Python

Sai Mohan Pulamolu
Updated on 09-Aug-2023 16:35:59

3K+ Views

When working with automation tasks, opening links programmatically is a very common requirement. Selenium, a popular web testing framework, provides powerful tools to handle web pages and perform various actions like opening links and etc. In this article, we will learn various methods to open links in Selenium using Python. Prerequisites Before we get started just make sure that you have the following software installed: Python: Install Python, if you haven't already. Selenium: Install Selenium by running pip install selenium in your command prompt. Web Driver: Selenium requires a web driver to interface with the chosen browser. You need to download ... Read More

C program to implement DFS traversal using Adjacency Matrix in a given Graph

Pranavnath
Updated on 09-Aug-2023 15:58:59

5K+ Views

Introduction Graph theory allows us to study and visualize relationships between objects or entities. In the current technology of computer science, graph traversal plays a crucial role in exploring and analyzing different types of data structures. One of the crucial operations performed on graphs is traversal - visiting all vertices or nodes, following specific paths. DFS traversal, based on a depth-first approach, allows us to explore the depths of a graph before backtracking and exploring other branches. In this article, we will involve in implementing DFS traversal using an adjacency matrix representation in C. DFS traversal using Adjacency Matrix ... Read More

Iterate Through List of Dictionaries in Python

Sai Mohan Pulamolu
Updated on 09-Aug-2023 16:08:16

10K+ Views

In this article, we will learn various methods to iterate through the list of dictionaries in Python. When working with data in Python, it is very common to encounter scenarios where you have a list of dictionaries. Each dictionary represents an individual data entry, and you need to perform operations or extract specific information from these dictionaries. Using a For Loop and Dictionary Access Methods The approach is to use a for loop to iterate through each dictionary in the list. Inside the loop, we can use dictionary access methods like keys(), values(), or items() to retrieve the keys, values, ... Read More

Iterate Over Words of a String in Python

Sai Mohan Pulamolu
Updated on 09-Aug-2023 15:56:15

2K+ Views

In this article, we will learn various methods to iterate over words of a string in Python. Understanding how to access and manipulate words in a string is a very important skill for any Python programmer, as it allows for efficient text processing and analysis. We will discuss the problem statement and provide solutions using different approaches in Python. Using the split() Method Syntax string.split(separator, maxsplit) The split() method takes two optional parameters: separator and maxsplit. By default, the separator is any whitespace, and maxsplit is −1, which means the method will split the string at every occurrence of ... Read More

Check if there are T number of Continuous of Blocks of 0s or not in given Binary Matrix

Pranavnath
Updated on 09-Aug-2023 15:24:04

201 Views

Introduction Binary matrices are widely used in computer science and various fields to represent data or solve complex problems efficiently. In some cases, it becomes important to identify whether a given binary matrix contains continuous blocks of zeros. In this article, we will explore an elegant solution using C++ code that allows us to detect if there are T number of continuous blocks of zeroes within a given binary matrix. This approach is both intuitive and efficient, making it suitable for practical implementation. Check if there are T number of continuous of blocks of 0s or not Given ... Read More

Count of Root to Leaf Paths Consisting of at most M Consecutive Nodes having Value K

Pranavnath
Updated on 09-Aug-2023 15:15:25

216 Views

Introduction Binary trees are fascinating data structures that have numerous applications in computer science and programming. One interesting problem is finding the count from the given tree composed of a parent along with its child nodes. The Binary tree is composed of nodes and the root node is decided and from which the child nodes can be given according the user need. The K value is decided and the way it traverses is chosen by the M value. Count of Root to Leaf Paths The graph is created with various nodes holding the values in form of ... Read More

Show Pearson Correlation Test Between Two Variables using Python

Vishal Gupta
Updated on 29-Sep-2023 14:54:46

497 Views

The Pearson Correlation Test is a simple statistical method in Python that measures the relationship between two parameter variables. It is useful to measure the relationship between two variables graphically, so you can know how strong the relationship is between the variables and whether they are related or not. To find Pearson Correlation we can use pearsonr() function. Its value falls between -1 and 1, with -1 being a perfect negative correlation, 0 representing no relationship, and 1 representing a perfect positive correlation. Syntax This syntax is used in all the following examples. pearsonr(variable1, variable2) Algorithm Step ... Read More

Pie Syntax (@) in Python

Vishal Gupta
Updated on 29-Sep-2023 14:33:09

359 Views

The Pi method or Pi Syntax is used to decorate a function or method in Python, and is known as a decorator. The pie method is used to modify the behaviour of a function or method. Pie Syntax (@) can be used by simply placing the @ symbol and the name of the decorator function above the definition of the function. When the function is invoked, Python is instructed to use the decorator. Pie Syntax (@) has the benefit of allowing for more adaptability in function calls. When working with complicated data structures or when you need to put in ... Read More

Phrase extraction in String using Python

Vishal Gupta
Updated on 29-Sep-2023 11:18:53

323 Views

Phrase extraction in Python is the process of identifying meaningful words from a text context. In this, the text is divided into sentences, phrases, words etc. and these phrases are displayed with full meaning. This process is useful in areas such as text analysis, machine learning, and supply-demand identification (information retrieval). Phrase extraction can be used in normal language processing (NLP) tasks to separate phrases from sentences. It can help to recognize words that are known as phrases and can be used for translation, summarising etc. Here we have some method to phrase extraction. Method 1 Using list slicing, enumerate(), ... Read More

Pendulum Module in Python

Vishal Gupta
Updated on 29-Sep-2023 14:28:24

814 Views

The Pendulum Module is used in Python for datetime manipulation and time zone management. Using this module, you can manage date, time, and other related things over time. The Pendulum Module's ability to manage time zones easily is one of its main advantages. It makes it simple to deal with dates and times from all around the world since it can instantly convert between various time zones. The Pendulum Module is a powerful tool for anyone who is dealing with time-sensitive data. You can install this module with following command − pip install pendulum We have some methods in Pendulum ... Read More

Advertisements