Get the Last N Characters of a String in Python

Asif Rahaman
Updated on 18-Jul-2023 13:59:46

5K+ Views

String Manipulation is an important task in Python. This may involve slicing the string, taking N characters, etc. These are essential tasks in Text preprocessing, like in NLP tasks, Password and data security, string comprehension and encoding, etc. Fortunately, Python offers a variety of ways to perform string manipulation. In this article, we will learn how to obtain the last N characters in a String in Python. Using for Loop The loop is a very common expression for most programming languages. This allows us to iterate over iterable objects, generate a series of values, and more. Since the String ... Read More

Get the First Element in List of Tuples in Python

Asif Rahaman
Updated on 18-Jul-2023 13:57:02

2K+ Views

Tuples are immutable data types in Python that can hold heterogeneous data types. List, on the other hand, are multiple data types that can hold heterogeneous data. In this article, we will explore various methods to retrieve the first element from a list of tuples using function−based components. We will explore several methods like loops, list comprehension, zip method, etc. Using Loop Method Loops are common statements in almost any Programming language. We can use the loop statement along with the indexing property of the iterable objects of Python to access the first elements of the iterable objects. ... Read More

Get List of Files in a Directory with Size Using Python

Asif Rahaman
Updated on 18-Jul-2023 13:54:39

2K+ Views

Directories are special kind of nodes in the computer system that contains other nested folders, files, etc. To list down the directories, we need special libraries or modules of Python like os module, glob module, etc. They also provide us the methods to access the size of the directory. The size of the directory is the space occupied by the directory in the computer ROM. In this article, we will explore how to get the list of files in a directory along with the size. Using OS Module The Python os module is a powerful tool that allows developers to ... Read More

Get List of Files in Directory Sorted by Size Using Python

Asif Rahaman
Updated on 18-Jul-2023 13:52:54

679 Views

Directory contains special nodes in computer paths that hold information about other nested paths but do not contain any information. Since they contain files and other directories, they have some size. Sorting by size means ordering the directories in terms of the space occupied by the directories in the disks. In this article, we will explore several methods, like using the os module, glob module, etc. sorted, lambda functions, etc., to perform the same. Using the OS and Operator Modules The os module Python provides a way to interact with the operating System. It offers various functions for operating ... Read More

Get Month from Year and Weekday using Python

Asif Rahaman
Updated on 18-Jul-2023 13:50:49

845 Views

Dealing with time is one of the most important aspects of any day−to−day activity. In this article, we will discuss how to get month from year and weekday using Python. We will utilize Python's two most popular libraries, namely calendar, and datetime, to deal with the months, year, s, etc. Both libraries provide several in−built methods to deal with time. We do not need to exclusively care for challenging tasks like leap year if we deal with such libraries. Using The Calendar Library The calendar library in Python provides useful functions and classes working with the calendar and the ... Read More

Check Anagram of Two Strings Using HashMap in Java

Way2Class
Updated on 18-Jul-2023 13:48:25

2K+ Views

Anagram Strings are those strings that have the same characters in each of the strings only the order in which they are arranged changes. In other words, a string is an anagram string if it forms a meaningful word after rearranging the characters of the other string. Some examples of anagram strings are “cat and act”, “care and race”. Both of them have the same characters and their frequencies. In this article, we will be discussing the approach to check whether the two strings are anagrams of each other or not using the HashMaps in Java. Problem Statement ... Read More

Line Chart Using Plotly in Python

Siva Sai
Updated on 18-Jul-2023 13:38:05

656 Views

Plotly is an interactive, open-source toolkit that enables users to build a wide range of aesthetically pleasing and intelligent charts in the field of data visualisation in Python. The line chart, one of the most popular chart forms, is the subject of this article. In order to help you comprehend, we'll go over how to make line charts using Plotly while using practical examples. Even though we'll focus mostly on line charts, keep in mind that Plotly is a flexible library that supports a wide range of additional chart styles, offering countless opportunities to tell engaging tales with data. A ... Read More

Line Chart in Pygal

Siva Sai
Updated on 18-Jul-2023 13:36:43

518 Views

Pygal stands out among the different Python data visualisation tools. The SVG (Scalable Vector Graphics) outputs from Pygal strike an excellent balance between elegance and customization. This article is devoted to building line charts in Pygal and includes pertinent examples to aid with comprehension. The development of line charts is the main emphasis of this book, however Pygal has many other features and a wide range of chart styles to meet a variety of data visualisation requirements. Pygal: A Quick Recap An open-source Python package called Pygal is used to produce stunning SVG charts that are both interactive and browser-friendly. ... Read More

Limited Rows Selection with Given Column in Pandas

Siva Sai
Updated on 18-Jul-2023 13:35:53

233 Views

Pandas, a Python package, is now the tool of choice for data scientists and analysts all around the world. Row and column selection from dataframes is one of its many functions for data manipulation and analysis. This article examines, using real-world examples, how to use Pandas to pick a set number of rows with a particular column. While we emphasise one particular feature of Pandas, keep in mind that the library's capabilities go much beyond this, making it a crucial tool for data processing. Pandas DataFrame: A Brief Introduction For Python, Pandas offers a fast, user-friendly data structure (DataFrame) and ... Read More

Limitations of Selenium WebDriver

Siva Sai
Updated on 18-Jul-2023 13:33:50

829 Views

Web testing has undergone a revolution thanks to Selenium WebDriver, a potent technology. This open-source framework is crucial to web application testing since it enables developers to automate browsers. Selenium WebDriver does have some restrictions, though, much as any tool. In order to better comprehend these restrictions, this article explores them and offers specific instances. Please be aware that while this article describes the limitations of Selenium WebDriver, it does not discount the enormous value and flexibility that it provides to developers all over the world. The Selenium WebDriver: A Brief Overview A component of the Selenium Suite called Selenium ... Read More

Advertisements