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
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
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
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
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
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
We all know that Excel is a very robust application offered by Microsoft which we use to analyze, organize and visualize our data to extract useful information. So let us assume that we are working in excel sheets. Now while working in excel sheet, there are chances that we leave blank spaces, for eg. leaving blank rows. So from this the built in functions of excel does not work properly. So here you will be going to learn how leaving blank spaces in cells can lead to various problems and so we will learn how to prevent blank or ... Read More
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
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
Let us assume that we are working in an excel sheet. Now there are chances that we need to share our excel sheet with other people. Now the data in our excel sheet is very precious and any carelessness with the data can lead us into trouble. So there should always be some protection associated with our excel so that we can prevent it from being deleted. We don’t want our viewers to make unnecessary changes to our excel sheet which can create a problem to others. Excel provides many built in functionalities which we can use to protect our ... Read More