Found 26504 Articles for Server Side Programming

Python program to delete prefix substring from the given string

Tapas Kumar Ghosh
Updated on 01-Jun-2023 14:49:26

276 Views

In this article, we will learn how to create a Python program to delete prefix substrings from a given string. Sometimes in data, we have a prefix of multiple words of the same type and if we want to delete them then it will take a lot of time but this can be solved by giving an algorithm to it. A prefix is a group of characters that are added to the beginning. Let’s take an example to understand this. The given string variable is “My shirt color is Red” and delete the prefix variable i.e. “My”. Then, the final ... Read More

Python program to delete suffix from the given string

Tapas Kumar Ghosh
Updated on 01-Jun-2023 14:47:41

2K+ Views

In Python, we have some built-in string functions like rstrip(), replace(), and endswith() that can be used to delete suffix from the given string. The delete suffix is termed by removing the group of characters at the end of the string. Sometimes we find errors like suffix in any data and if we want to delete it, it takes a lot of time and this can be solved by giving an algorithm to it. The end character or substring is termed a suffix. Let’s take an example to understand this − The given string variable is BRIGHTNING and after removing ... Read More

Python program to convert a string into lowercase

Tapas Kumar Ghosh
Updated on 01-Jun-2023 14:42:02

739 Views

Python has various built-in functions that can be used for capitalization of the string. In this article develop a python program to perform this task using its lower() function. The lower() method converts each uppercase character in the input string to lowercase before returning the lowercased strings. It returns the original string if the given string contains no uppercase letters. The lower function doesn’t take any parameters. Let’s take an example to understand the conversion of string in lowercase − SCHOOL ----------- school UnIvErSiTy ----------- university Syntax ord() The ord() is a predefined function used in Python ... Read More

Analyzing Decision Tree and K-means Clustering using Iris dataset

Priya Mishra
Updated on 01-Jun-2023 11:03:17

743 Views

Decision trees and K-means clustering algorithms are popular techniques used in data science and machine learning to uncover patterns and insights from large datasets like the iris dataset. As we all know, Artificial Intelligence is employed extensively in our daily lives, from reading the news on a mobile device to analyzing complicated data at work. AI has improved the speed, accuracy, and efficiency of human endeavors. AI developments have enabled us to do things that were previously deemed impossible. Here in this article, we will learn about the decision tree algorithm and k means clustering algorithm and how to ... Read More

How to Alter an SQLite Table using Python?

Priya Mishra
Updated on 01-Jun-2023 10:43:29

1K+ Views

Altering an SQLite table is a common task when working with databases and can be easily done using Python. SQLite is a well-known open-source relational database management system that is used to store data in local files. In this article, we'll look at how to alter an SQLite table in Python by using the ALTER TABLE command to add, edit, or delete columns from an existing table. We will go through the necessary steps, including establishing a connection to the SQLite database, creating a cursor object, executing the ALTER TABLE statement, committing the changes, and closing a database connection. SQLite ... Read More

How to add values to the dictionary in Python?

Priya Mishra
Updated on 31-May-2023 18:14:16

427 Views

Python is a versatile and powerful programming language that has various built-in datatypes and one of the most useful built-in datatypes in Python is the dictionary which allows us to store and retrieve data in a key-value format, and we can easily add or remove values to a dictionary as compared to other built-in datatypes in Python. In this article, we will be discussing how to add values to a dictionary in Python and what are the various methods to do the same. What is a dictionary in Python? Before we get started with adding values to dictionaries in Python, ... Read More

How to add timestamp to excel file in Python?

Priya Mishra
Updated on 31-May-2023 18:06:39

3K+ Views

If you're working with data in Python and need to track changes or monitor updates, adding a timestamp to your Excel files can be a game-changer. When we are working with large quantities of data, excel can be used to analyze when specific modifications or events occurred. This can be accomplished by including a timestamp in the Excel file which will tell when a particular modification has been done to a cell. The modules required for adding timestamps to Excel files will be openpyxl and DateTime. In this article, we will see how to add timestamps and the modules used ... Read More

How to add text on an image using Pillow in Python?

Priya Mishra
Updated on 31-May-2023 17:11:30

12K+ Views

Pillow provides several tools and functions for working with images, including the ability to add text to an image. Adding text to an image can be useful for creating captions, labels, or annotations for images. In this article, we will explore how to add text on an image using Pillow in Python. We will discuss different methds for adding text, such as changing the font, size, color, and position of the text. We will also provide step-by-step instructions and code examples to help you get started with adding text on an image using Pillow. Pillow Python Pillow module is constructed ... Read More

How to add text in a heatmap cell annotations using seaborn in Python?

Priya Mishra
Updated on 31-May-2023 17:05:27

2K+ Views

Heatmaps are useful for identifying patterns and trends in data and can be further customized by adding annotations to the cells, such as text labels or numerical values, which can provide additional information about the data. In this article, we will discuss how to add text in heatmap cell annotations using Seaborn in Python. We will explore different methods and options available in Seaborn to customize the text annotations, such as changing the font size, color, and format of the text. Heatmap A heat map (or heatmap) is a kind of data visualisation in which the intensity of a phenomena ... Read More

How to add Regression Line Per Group with Seaborn in Python?

Priya Mishra
Updated on 31-May-2023 16:56:05

714 Views

One of the most useful tools provided by Seaborn is the ability to add regression lines to a scatterplot. Regression lines can be helpful in analyzing the relationship between two variables and identifying trends in the data. In this article, we will learn how to add Regression Line Per Group with Seaborn in Python. Seaborn has more than one way to make scatter plots between two numbers. For example, to make the plot we need, we can use the lmplot() function. Seaborn Seaborn is a library of Python for making graphs based on statistics. It is built on top of ... Read More

Advertisements