Found 10784 Articles for Python

How to Get the Last N characters of a String in Python

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

3K+ 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

Loan Approval Prediction using Machine Learning

Siva Sai
Updated on 18-Jul-2023 18:43:04

632 Views

Traditional industries are quickly embracing contemporary technologies to improve their operations in the age of digital transformation. Among these, the financial industry stands out for using cutting-edge approaches like machine learning (ML) for jobs like predicting loan acceptance. This post will provide a thorough explanation of how to anticipate loan acceptance using machine learning, along with real-world examples to aid in understanding. Introduction to Loan Approval Prediction Using information provided by the application, machine learning algorithms can predict whether or not a loan will be accepted. This is a type of classification problem. The applicant's salary, credit history, loan amount, ... Read More

How to Get the First Element in List of Tuples in Python?

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

858 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

Loading Images in Tkinter using PIL

Siva Sai
Updated on 18-Jul-2023 18:41:12

941 Views

Python, an incredibly flexible programming language, has a variety of libraries that can handle diverse tasks. Tkinter emerges as Python's default package when it comes to creating a graphical user interface (GUI). Similar to this, the Python Imaging Library (PIL) is frequently used for image processing. In order to properly explain how to load images in Tkinter using PIL, this guide combines the two and includes real-world examples. Introduction to Tkinter and PIL Let's quickly explain Tkinter and PIL before moving on to the main subject. The default GUI toolkit for Python is called Tkinter. It is easy to use ... Read More

Loading Image using Python Mahotas

Siva Sai
Updated on 18-Jul-2023 18:39:53

122 Views

Python is known for its strong libraries that can handle nearly any task, and image processing is no different. For this purpose, a popular choice is Mahotas, a computer vision and image processing library. This article explores how to load images using Python's Mahotas, providing you with practical examples. Introduction to Mahotas Mahotas is a sophisticated library that contains numerous methods for image processing and computer vision. With a strong focus on speed and productivity, Mahotas enables you use over 100 features, including color space conversions, filtering, morphology, feature extraction, and more. This guide focuses on one of the most ... Read More

Loading Excel spreadsheet as pandas DataFrame

Siva Sai
Updated on 18-Jul-2023 18:37:18

625 Views

With the rising significance of data analysis in various domains, Python has become the go-to language due to its vast array of libraries designed to deal with data. One such library is Pandas, a powerful tool that provides flexible data structures for data manipulation and analysis. This article provides an in-depth guide to loading an Excel spreadsheet as a Pandas DataFrame, complete with examples. Introduction to Pandas Pandas is a Python package that stands out for its ability to work efficiently with data. It provides two classes – the DataFrame and the Series – which are incredibly flexible and can ... Read More

Loading Data in Pytorch

Siva Sai
Updated on 18-Jul-2023 18:36:11

221 Views

Every machine learning project depends on data, and PyTorch, the well-known open-source machine learning toolkit created by Facebook, is no exception. This manual seeks to streamline the data loading procedure into PyTorch and get you up and running as soon as possible. The DataLoader, Dataset, and Transform classes of PyTorch will be the main topics of this article. To help you understand these core PyTorch ideas and streamline your machine learning applications, we'll go over some real-world examples. PyTorch Data Loading: A Brief Overview For importing and preparing data, PyTorch offers a powerful and adaptable toolbox. The three key elements ... Read More

Get the list of Files in a Directory with Size using Python

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

885 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 the List of Files in a Directory Sorted by Size Using Python.

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

281 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

Load Text in Tensorflow

Siva Sai
Updated on 18-Jul-2023 18:34:47

165 Views

A well-known open-source framework called TensorFlow, created by Google, has established itself as a crucial resource in the field of deep learning and machine learning. It has strong and incredibly diverse data processing abilities, especially when working with text data. This article provides a thorough explanation of how to import text data into TensorFlow along with useful examples. Introduction to TensorFlow Data flow graphs are used to calculate numbers using the potent library TensorFlow. High-dimensional arrays (tensors) can be operated on using these graphs in order to conduct intricate mathematical operations. TensorFlow has been essential in improving artificial intelligence (AI) ... Read More

Advertisements