Found 33676 Articles for Programming

How to Run Two Async Functions Forever in Python

Rohan Singh
Updated on 18-Jul-2023 16:57:19

9K+ Views

Async functions, also known as coroutines, are functions that can be paused and resumed during their execution. In Python, the asyncio module, provides a powerful framework for writing concurrent code using coroutines, which are special functions that can be paused and resumed. In this article, we will explore how to run two async functions forever using asyncio in Python. Async Functions Async functions, also known as coroutines, are functions that can be paused and resumed during their execution. They allow for concurrent execution of code without blocking the main thread, thus enabling efficient utilization of system resources. To define an ... Read More

Get information about YouTube Channel using Python

Atharva Shah
Updated on 18-Jul-2023 17:48:53

1K+ Views

YouTube, the world's largest video-sharing website, hosts a wide variety of media. Individuals or groups can create channels on YouTube, and recordings can be uploaded for others to view. Using Python, we will use the Google API in this tutorial to learn more about a YouTube channel. Installation pip install --upgrade google-api-python-client Navigate to https://console.cloud.google.com/ to access the Google Cloud Console. Choose an existing project or start a new one. On the left-hand menu, pick APIs & Services > Dashboard by clicking the "Navigation menu" symbol . Choose "+ ENABLE APIS AND SERVICES" from the menu.In the ... Read More

Get Indian Railways Station code Using Python

Atharva Shah
Updated on 18-Jul-2023 17:48:07

334 Views

Web scraping is only one of the many uses for the flexible programming language Python. We'll discover how to use Python to extract station codes for Indian Railways in this blog post. Each Indian railway station has a specific identification number, or station code. They are used to make reservations for tickets, look at train timetables, and find other relevant data. Installation To start with, we need to install the requests and Beautiful Soup libraries. Requests is a Python library used for sending HTTP requests, while Beautiful Soup is a library used for web scraping purposes. To install requests, open ... Read More

Get index in the list of objects by attribute in Python

Atharva Shah
Updated on 18-Jul-2023 17:47:00

2K+ Views

Lists are a common data structure in Python for storing a collection of objects. On occasion, you might need to locate the index of a certain item in the list using the value of a particular characteristic. This can be a difficult process, particularly if the list has a lot of things but Python has a simple method for obtaining the index in the list of objects by attribute which we will be exploring in this article. Syntax To find the index in the list of objects according to an attribute, use the syntax shown below − index = next((i ... Read More

Segmentation in Operating System

Pranavnath
Updated on 18-Jul-2023 17:02:25

12K+ Views

In the Operating System, Segmentation is mainly useful to maintain the modular structure of a program. The purpose of using segmentation is to achieve the user's view of memory allocation similarly when paging does not bother where programs start and end and it simply divides the program into pages. The non-adjacent memory allocation technique can be divided into two types namely paging and segmentation. In segmentation, the program is not divided randomly or with a variable size but with a fixed page. Segmentation in OS The segmentation technology is used in operating systems and the process is divided into many ... Read More

Get Flight Status using Python

Atharva Shah
Updated on 18-Jul-2023 17:46:16

897 Views

"Flight status" refers to the present condition of a flight, such as whether it is on schedule, running behind schedule, or being cancelled. You may find out the status of a flight by visiting the airline's website and entering the flight number or the airports of departure and arrival. The essential data is then taken from the HTML page and structured by the BeautifulSoup module and used to assess if a flight is on time, delayed, or cancelled. To obtain the flight status for this blog post, we'll utilise Python. Installation It's essential that Python and the BeautifulSoup library ... Read More

How to Resize Matplotlib RadioButtons

Rohan Singh
Updated on 18-Jul-2023 16:31:32

178 Views

Matplotlib is a popular data visualization library in Python that provides a wide range of tools for creating interactive plots and charts. One of the interactive components offered by Matplotlib is the RadioButtons widget, which allows users to select a single option from a group of mutually exclusive choices. While working with RadioButtons, you may encounter situations where you need to resize them to better fit your plot or application layout. In this article, we will explore different methods to resize Matplotlib RadioButtons. Syntax radio_buttons.ax.set_position([left, bottom, width, height]) Here, radio_buttons refers to the instance of the RadioButtons widget. ... Read More

Get first n records of a Pandas DataFrame

Atharva Shah
Updated on 18-Jul-2023 17:44:27

3K+ Views

Working with large datasets in Pandas can often be a daunting task, especially when it comes to retrieving the first few records of a dataset. In this article, we will explore the various ways to get the first n records of a Pandas DataFrame. Installation and Syntax We must make sure that Pandas is installed on our system before moving further with the implementation so run the pip command in your terminal − pip install pandas Once installed, we can create a DataFrame or load a CSV and then retrieve the first N records. Algorithm A Pandas DataFrame's first ... Read More

Get Financial Data from Yahoo Finance with Python

Atharva Shah
Updated on 18-Jul-2023 17:42:44

4K+ Views

Trading, investing, and other financial professionals need access to financial data since investment research is reliant on it. Yahoo Finance, which offers up-to-date market statistics, news, and analysis, is one of the most well-known sources of financial information. Python is a robust and flexible programming language that can be used to extract financial data from Yahoo Finance, so in this post, we'll be utilizing the yfinance package to do just that. Installation and Syntax Before we get started, we need to install the yfinance library, which allows us to access Yahoo Finance data from Python. We can install yfinance using ... Read More

How to Resample Time Series Data in Python

Rohan Singh
Updated on 18-Jul-2023 16:28:45

4K+ Views

Time series data is a sequence of observations collected over time at regular intervals. This data can be of any domain such as finance, economics, health, and environmental science. The time series data we collect can sometimes be of different frequencies or resolutions, which may not be suitable for our analysis and data modeling process. In such cases, we can Resample our time series data by changing the frequencies or resolution of the time series by either upsampling or downsampling. This article will explain different methods to upsample or downsample the time series data. Upsampling Upsampling means increasing the frequency ... Read More

Advertisements