Found 26504 Articles for Server Side Programming

Get the data type of column in Pandas - Python

Tarandeep Singh
Updated on 29-May-2023 12:33:09

19K+ Views

Pandas is a popular and powerful Python library commonly used for data analysis and manipulation. It offers a number of data structures, including the Series, DataFrame, and Panel, for working with tabular and time-series data. Pandas DataFrame is a two-dimensional tabular data structure. In this article, we'll go through various methods for determining a column's data type in Pandas. There can be numerous cases where we have to find the data type of a column in Pandas DataFrame. Each column in a Pandas DataFrame can contain a different data type. Before Moving forward, let's make a sample dataframe on which ... Read More

Get tag name using Beautifulsoup in Python

Tarandeep Singh
Updated on 29-May-2023 12:29:04

3K+ Views

BeautifulSoup is known as one of the most widely used Python packages for web scraping. It is one of the most fantastic tools used for parsing HTML and XML documents, making it simpler and quicker to extract data from websites. Extraction of the tag name for particular HTML and XML components is one of the most frequent tasks in web scraping. Getting the tag name of a given element is one of the most frequent tasks when working with HTML and XML documents. Python’s BeautifulSoup library can be installed using the below command: pip install beautifulsoup4 Approach ... Read More

Get specific row from PySpark dataframe

Tarandeep Singh
Updated on 29-May-2023 12:20:37

10K+ Views

PySpark is a powerful tool for data processing and analysis. When working with data in a PySpark DataFrame, you may sometimes need to get a specific row from the dataframe. It helps users to manipulate and access data easily in a distributed and parallel manner, making it ideal for big data applications. In this article, We will explore how to get specific rows from the PySpark dataframe using various methods in PySpark. We will cover the approaches in functional programming style using PySpark's DataFrame APIs. Before Moving forward, let's make a sample dataframe from which we have to get the ... Read More

Emotion classification using NRC Lexicon in Python

Jaisshree
Updated on 22-May-2023 10:11:45

2K+ Views

Emotion identification or recognition is the ability of a person or an object to sense a particular emotion exhibited in the environment and place it into one of the many categories of emotions. Emotion Classification in python is a feasible alternative to the traditional sentiment analysis technique which labels words or sentences as positive or negative and allots them with a polarity score accordingly. The basic ideology behind this algorithm is to mimic the human thought process and it tries to segment the words portraying emotions from the text. The analysis is performed with a training set of data where ... Read More

Email + Social Logins in Django - Step-by-Step Guide

Jaisshree
Updated on 22-May-2023 09:57:26

432 Views

Email and social logins are common techniques for websites and apps to allow users to establish accounts or check in. Users must provide their email address and password for email login, however, social login allows users to sign in using their social networks accounts, such as Facebook or Google. In this tutorial, we'll go through how to set up email and social logins in Django. Method With Django, there are numerous ways to incorporate email and social logins. The Django-allauth package, which supports authentication for numerous login methods, including email and social logins, is one of the most prevalent. Another ... Read More

string__npos in C++ with Examples

Siva Sai
Updated on 18-May-2023 14:10:08

2K+ Views

In this article, we will delve into a specific aspect of string handling in C++: the string::npos constant. string::npos is a static member constant value with the greatest possible value for an element of type size_t. This constant is defined with a value of -1, which, when cast to size_t, gives us the largest possible representation for size_t. In the context of strings in C++, it is generally used to indicate an invalid position. What is String::npos? In C++, string::npos is a constant static member of the std::string class that represents the maximum possible value for the size_t type. It ... Read More

Random password generator in C

Siva Sai
Updated on 18-May-2023 14:00:09

2K+ Views

In this article, we will delve into an interesting and practical problem related to string manipulation in C programming. We are going to build a "Random Password Generator" in C. This problem not only enhances your understanding of string manipulation but also your knowledge of the C Standard Library. Problem Statement The task is to build a program that generates a random password of a specified length. The password should include uppercase and lowercase alphabets, digits, and special characters. C Solution Approach To solve this problem, we'll leverage the power of the C Standard Library. We'll use the rand() function ... Read More

Python program to find the smallest word in a sentence

Siva Sai
Updated on 18-May-2023 12:36:45

630 Views

Welcome to this in-depth tutorial on how to write a Python program to find the smallest word in a sentence. Whether you are a beginner or an intermediate Python programmer, this guide will offer the knowledge and skills necessary to use Python's powerful features in text manipulation. Problem Statement Given a sentence, our task is to find the smallest word. The "smallest" word refers to the word with the fewest characters. In case of a tie, we'll return the first occurring smallest word. Approach We start by splitting the sentence into words, which we'll accomplish by using spaces as the ... Read More

Modify string by rearranging vowels in alphabetical order at their respective indices

Siva Sai
Updated on 18-May-2023 12:25:24

216 Views

In this article, we will discuss how to modify a given string in C++ by rearranging the vowels in alphabetical order at their respective indices. We will also explain the approach used to solve this problem and provide an example with a test case. Problem Statement Given a string, rearrange the vowels in alphabetical order at their respective indices. The consonants in the string should remain in their original order. For example, given the string "tutorialspoint", the output should be "tatiriolspount". Approach The problem can be solved using a simple algorithm. We can first create a separate string that contains ... Read More

Modify string by inserting characters such that every K-length substring consists of unique characters only

Siva Sai
Updated on 18-May-2023 12:23:02

197 Views

A common task when working with strings is to make sure that a string adheres to certain conditions. One of these conditions could be to ensure that every substring of length K in the string contains unique characters only. This is a frequent requirement in problems related to data encoding, string manipulation, and cryptography. Problem Statement The problem we are trying to solve can be stated as follows − Given a string str and an integer K, modify the string by inserting characters such that every substring of length K in the string contains unique characters only. Proposed Solution We ... Read More

Advertisements