Server Side Programming Articles

Page 99 of 2109

Get information about YouTube Channel using Python

Atharva Shah
Atharva Shah
Updated on 27-Mar-2026 2K+ Views

YouTube, the world's largest video-sharing platform, hosts millions of channels with diverse content. Using Python and the YouTube Data API, we can programmatically retrieve detailed information about any YouTube channel, including subscriber count, view statistics, and video metrics. Installation First, install the Google API client library ? pip install --upgrade google-api-python-client Getting YouTube API Key To access YouTube data, you need an API key from Google Cloud Console ? Navigate to https://console.cloud.google.com/ to access the Google Cloud Console Create a new project or select an existing one Click "Navigation menu" → ...

Read More

Get Indian Railways Station code Using Python

Atharva Shah
Atharva Shah
Updated on 27-Mar-2026 411 Views

Web scraping is one of the many powerful uses for Python. In this article, we'll discover how to extract Indian Railways station codes using Python. Each Indian railway station has a unique identification code used for ticket reservations, train schedules, and other railway information. Installation First, we need to install the required libraries. Requests is used for sending HTTP requests, while Beautiful Soup is used for parsing HTML content. To install the required packages, open your terminal and run − pip install requests pip install beautifulsoup4 Algorithm Define a function get_html ...

Read More

Get index in the list of objects by attribute in Python

Atharva Shah
Atharva Shah
Updated on 27-Mar-2026 2K+ Views

Lists are a common data structure in Python for storing a collection of objects. Sometimes you need to find the index of a specific item in the list based on an attribute value. Python provides several efficient methods for getting the index in a list of objects by attribute. Syntax To find the index in a list of objects by attribute, use this syntax − index = next((i for i, obj in enumerate(my_list) if obj.attribute == desired_value), None) The next() method returns the first index where the object's attribute matches the desired value. If ...

Read More

Get Flight Status using Python

Atharva Shah
Atharva Shah
Updated on 27-Mar-2026 1K+ Views

Flight status refers to the current condition of a flight, indicating whether it is on schedule, delayed, or cancelled. Python provides powerful tools to extract flight information from airline websites using web scraping techniques with BeautifulSoup and requests libraries. Installation Before starting, ensure Python and the required libraries are installed on your system − pip install requests pip install beautifulsoup4 Algorithm Overview The flight status retrieval process follows these key steps − Import necessary libraries: requests, BeautifulSoup, and datetime Define the get_flight_details() function to construct URL and fetch HTML data Parse ...

Read More

Get first n records of a Pandas DataFrame

Atharva Shah
Atharva Shah
Updated on 27-Mar-2026 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 Setup We must make sure that Pandas is installed on our system before moving further with the implementation ? pip install pandas Once installed, we can create a DataFrame or load a CSV and then retrieve the first N records. Methods to Get First n Records ...

Read More

Get Financial Data from Yahoo Finance with Python

Atharva Shah
Atharva Shah
Updated on 27-Mar-2026 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 article, we'll be utilizing the yfinance package to do just that. Installation and Setup Before we get started, we need to install the yfinance library, which allows us to access Yahoo Finance data from Python. We can install ...

Read More

How to Resample Time Series Data in Python

Rohan Singh
Rohan Singh
Updated on 27-Mar-2026 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 through either upsampling or downsampling. Understanding Resampling Resampling involves changing the frequency of time series observations. Upsampling increases frequency (daily to hourly), while downsampling decreases frequency (daily ...

Read More

How to Multiply All Items in a Tuple in Python

Rohan Singh
Rohan Singh
Updated on 27-Mar-2026 4K+ Views

In Python, tuples are immutable sequences that can contain a collection of elements. We can multiply all the items in a tuple using various methods like using a for loop, using the reduce() function from the functools module, and the math.prod() function. In this article, we will explore all these methods to multiply all items in a tuple in Python. Using for Loop This method is straightforward and easy to understand. It involves iterating over each item in the tuple and multiplying them one by one using a for loop. Syntax for item in my_tuple: ...

Read More

How to Group Strings on Kth character using Python?

Rohan Singh
Rohan Singh
Updated on 27-Mar-2026 473 Views

In Python, grouping strings based on their Kth character is a common string manipulation task. We can accomplish this using several approaches: regular dictionaries, defaultdict from collections, and itertools.groupby(). Each method offers different advantages depending on your specific needs. Method 1: Using a Dictionary The simplest approach uses a regular dictionary to group strings by their Kth character. We manually check if a key exists before adding strings to the corresponding group. Example Here's how to group strings by their 2nd character using a dictionary ? def group_strings_on_kth_char(strings, k): grouped_strings ...

Read More

How to Get the Nth Word in a Given String using Python?

Rohan Singh
Rohan Singh
Updated on 27-Mar-2026 2K+ Views

Extracting specific words from a string is a common programming task. Python provides several approaches to get the Nth word from a string, including split() method, regular expressions, and custom delimiters. Using split() Method The simplest approach is splitting the string into words and accessing by index ? Syntax words = string.split() nth_word = words[n-1] # n is 1-based index Example def get_nth_word_split(string, n): words = string.split() if 1

Read More
Showing 981–990 of 21,090 articles
« Prev 1 97 98 99 100 101 2109 Next »
Advertisements