Found 10784 Articles for Python

How to check horoscope using Python?

Niharika Aitam
Updated on 09-Aug-2023 16:00:18

106 Views

Checking horoscope using Python Python is used in many applications all over the world. One of the applications is to check the horoscope on that day or day after using the Beautifulsoup of the python language. The following are the steps to be followed to check the horoscope using python. Installing the beautifulsoup Firstly, we have to install the beautifulsoup package in our python working envinornment. The below is the code. pip install bs4 The output of installing the beautifulsoup is as follows. Collecting bs4 Downloading bs4-0.0.1.tar.gz (1.1 kB) Preparing metadata (setup.py): started ... Read More

How to check if the PyMongo Cursor is Empty?

Niharika Aitam
Updated on 09-Aug-2023 15:41:50

1K+ Views

PyMongo is one of the libraries in python which provides a way to interact with the MongoDB , the most popular NoSQL document oriented database. It allows the developers to easily connect with the mongoDB instances and interact with the databases and collections, insert and retrieve the documents and other various operations. Cursors in PyMongo A cursor in MongoDB is an object that points to the documents. When we execute the find() method by passing a search query as a parameter, the results of the given query are returned in the form of a cursor object. By iterating ... Read More

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

123 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

459 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

100 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

444 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

123 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

How to Color Scatterplot by a variable in Matplotlib?

Niharika Aitam
Updated on 09-Aug-2023 15:17:15

2K+ Views

There are several ways to color scatterplot by a variable in Matplotlib of the python library. We have three parameters in scatter function namely cmap, alpha and c using which we can change the color of the plot. Matplotlib is one of the libraries available in python which is used to plot and visualize the given data. This can be used as the extension of the Numpy library to plot the arrays. This library has the module called pyplot which makes the visualization and plotting the data very easy. This pyplot module has many functions and parameters which ... Read More

Advertisements