Atharva Shah

Atharva Shah

60 Articles Published

Articles by Atharva Shah

Page 4 of 6

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 412 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

Find the size of a Dictionary in Python

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

In Python, you often need to determine the size of a dictionary for memory allocation, performance optimization, or data validation. Python provides two main approaches: counting key-value pairs using len() and measuring memory usage with sys.getsizeof(). Syntax The syntax to determine a dictionary's size is straightforward ? # Count key-value pairs size = len(dictionary) # Get memory size in bytes import sys memory_size = sys.getsizeof(dictionary) Using len() Function The len() function returns the number of key-value pairs in the dictionary ? my_dict = {"apple": 2, "banana": 4, "orange": 3} size ...

Read More

Find the siblings of tags using BeautifulSoup

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

Data may be extracted from websites using the useful method known as web scraping. A popular Python package for web scraping is BeautifulSoup, which offers a simple method for parsing HTML and XML documents. Finding the siblings of a tag is a frequent task while scraping web pages − siblings are any additional tags that have the same parent as the primary tag. Installation and Setup To use BeautifulSoup, you must first install it using pip ? pip install beautifulsoup4 Once installed, you can import BeautifulSoup in your Python code ? from ...

Read More

Find the profit and loss in the given Excel sheet using Pandas

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

Pandas is a popular data manipulation and analysis library in Python that is widely used by data scientists and analysts. It provides several functions for working with data in Excel sheets. One of the most common tasks in analyzing financial data is finding the profit and loss in a given Excel sheet. Setup To handle Excel files in Python, you need to install the openpyxl dependency. To do this, open your terminal and type the command − pip install openpyxl After successful installation you can proceed with experimenting with Excel files and spreadsheets. ...

Read More

Find the position of number that is multiple of certain number

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

When working with lists in Python, you often need to find the positions (indices) of numbers that are multiples of a specific number. Python provides several approaches to accomplish this task efficiently using loops, list comprehension, and built-in functions. Algorithm Define a list of numbers Iterate through the list and find numbers that are multiples of the desired number Store the positions of the multiples in a separate list Using List Comprehension List comprehension provides a concise way to find positions of multiples ? numbers = [2, 4, 6, 8, 10, 12, ...

Read More
Showing 31–40 of 60 articles
Advertisements