Found 27104 Articles for Server Side Programming

How to check whether user's internet is on or off using Python?

Niharika Aitam
Updated on 09-Aug-2023 15:40:38

7K+ Views

Generally, if you need to verify whether your current system is connected to the internet or not, we can do so, by simply sending request to any of webserver application using the browser or, using the dos command ping. The ping command is typically used to troubleshoot connectivity, reachability, and name resolution. Similarly, in Python we can verify the user’s internet connectivity status either by sending a request to any web application or by using the ping command. Using the request.get() method In python, the modules request helps us to send HTTP requests using Python. By sending requests ... Read More

How to click a href link from bootstrap tabs using Python?

Niharika Aitam
Updated on 09-Aug-2023 15:32:55

118 Views

Bootstrap is the popular HTML, CSS, JavaScript framework which helps us to develop responsive, mobile first, front end web applications. It provides design templates for forms, typography, navigation, buttons and other interface components. Python is the best language to manipulate the web content. The Selenium Library If we need to click a link using Python programming we should use the selenium library. It is the most popular open source automation testing tool which allows us to make the web browsers automate. Selenium is mainly used for the testing purpose of the automated web applications and also used for other ... Read More

How to clone webpage using pywebcopy in python?

Niharika Aitam
Updated on 09-Aug-2023 15:31:44

1K+ Views

Python provides Pywebcopy module, that allows us to download and store the entire website including all the images, HTML pages and other files to our machine. In this module, we have one of the functions namely save_webpage() which allows us to clone the webpage. Installing pywebcopy module Firstly, we have to install the pywebcopy module in the python environment using the following code. pip install pywebcopy On successful installation we will get the following output – Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/ Collecting pywebcopy Downloading pywebcopy-7.0.2-py2.py3-none-any.whl (46 kB) . . ... Read More

How to communicate JSON data between Python and Node.js?

Niharika Aitam
Updated on 09-Aug-2023 15:30:11

447 Views

JSON  can be abbreviated as JavaScript Object Notation. It is a text-based file used for transferring and storing data in programming languages. It is supported by the python programming language using a built-in package namely JSON, Its text is given in the quoted string format in which contains a key and value within the curly braces{} as same as a dictionary. For using JSON in python, we have to import the JSON package in python script. JSON package provides several methods, among them one of the methods is dumps. This is used to convert the python tuple objects into ... Read More

Training Unigram Tagger in NLP

Mithilesh Pradhan
Updated on 09-Aug-2023 12:07:58

96 Views

Introduction A single token is called a unigram. A unigram tagger is the type of tagger that requires only one word for inferring the Parts of Speech of a word. It has the context of a single word.NLTK library provides us with the UnigramTagger and is inherited from NgramTagger. In this article let us understand the training process of Unigram Tagger in NLP. Unigram Tagger and its training using NLTK WORKING The UnigramTagger is inherited from the ContextTagger. A context() method is implemented. The context method has the same arguments as the choose_tag() From the context() method, a ... Read More

How to combine Groupby and Multiple Aggregate Functions in Pandas?

Niharika Aitam
Updated on 09-Aug-2023 15:19:57

426 Views

The groupby() and aggregate() are the two functions available in the pandas library. The groupby() function The groupby() function allows you to group a DataFrame by one or more columns. It internally performs a combination of operations such as splitting the object, applying a function, and combining the results, on the dataframe object. This function returns DataFrameGroupBy object which contains information about the groups. Once we obtain this object we can perform various operations such as calculating the mean, calculating the sum and average etc… Syntax Following is the syntax of the groupby() function – DataFrame.groupby(by=None, axis=0, level=None, as_index=True, ... Read More

Training a tokenizer and filtering stop words in a sentence

Mithilesh Pradhan
Updated on 09-Aug-2023 12:03:46

119 Views

Introduction In NLP tokenizing text into sentences is a very crucial preprocessing task. Tokenization is the process of breaking the text corpus into individual sentences. In NLTK, the default tokenizer does a good task to tokenize text however it fails to do so in cases where the text contains punctuations, symbols, etc. that are non-standard. In such cases, we need to train a tokenizer. In this article let us explore the training of a tokenizer and also see the usage of filter words or stopwords. Tokenizing a Sentence in NLP The default tokenizer in NLTK can be used on the ... Read More

Synsets for a word in WordNet in NLP

Mithilesh Pradhan
Updated on 09-Aug-2023 11:53:20

608 Views

Introduction WordNet is a large database of words present in the NLTK library in present in many languages for Natural Language related use cases. NLTK library has an interface known as Synset that allows us to look for words in WordNet. Verbs, Nouns, etc. are grouped into sunsets. WordNet and Synsets The below diagram shows the structure of WordNet. In WordNet, the relationship between words is maintained. For example, words like sad are similar and find the application under similar contexts. These words can be interchanged during usage. These kinds of words are grouped for synsets. Each synset is ... Read More

How to choose elements from the list with different probability using NumPy?

Niharika Aitam
Updated on 09-Aug-2023 14:55:24

691 Views

There are multiple ways to choose elements from the list with the different probability using the numpy library. In python, NumPy library provides a module named random, which has several functions such as choice(), multinomial() etc., which are used to choose elements from an array with different probabilities. The sum of all probability values defined in the list should be equal to 1. Let’s see each way one by one. Using the random.choice() function The random module provides the function choice(), which is used to calculate a random sample from the given 1-d array with the specified probability distribution. ... Read More

How to check whether the element of a given NumPy array is non-zero?

Niharika Aitam
Updated on 09-Aug-2023 14:53:33

109 Views

There are multiple ways to check whether the element of a given Numpy array is Non-zero. Here are few common ways that we can apply. Using Boolean indexing Boolean Indexing is a technique in Numpy library, that allows for the selection of specific elements from the array based on the Boolean condition. This creates a Boolean mask containing True or False values, which have the same shape and size as per the Boolean condition. Example Following example how to use Boolean indexing to check whether the element of a given numpy array is non-zero. import numpy as np arr = ... Read More

Advertisements