Rohan Singh has Published 171 Articles

Get the indices of Uppercase Characters in a given String using Python

Rohan Singh

Rohan Singh

Updated on 17-Jul-2023 18:24:23

1K+ Views

In Python, we can get the indices of uppercase characters in a given string using methods like using List Comprehension, using a For Loop, using Regular Expressions etc. Finding the indices of Uppercase characters can be useful in text analysis and manipulation. In this article, we will explore different ... Read More

Get the Number of Characters, Words, Spaces, and Lines in a File using Python

Rohan Singh

Rohan Singh

Updated on 17-Jul-2023 18:22:34

6K+ Views

Text file analysis is a fundamental task in various data processing and natural language processing applications. Python is a versatile and powerful programming language that provides numerous built−in features and libraries to facilitate such tasks efficiently. In this article, we will explore how to count the number of characters, words, ... Read More

Get the summation of numbers in a string list using Python

Rohan Singh

Rohan Singh

Updated on 17-Jul-2023 18:20:00

454 Views

In Python, we can sum the numbers present in a string list using various methods like using Regular Expressions, using isdigit() and List Comprehension, using Splitting and Joining etc. When working with lists containing strings in Python, it is common to come across situations where you need to extract ... Read More

Globals() Function in Python

Rohan Singh

Rohan Singh

Updated on 17-Jul-2023 18:16:59

131 Views

In Python, every program has a symbol table that contains the information about its names (variables, functions, and classes) defined in the program. The global() function allows us to access and manipulate the global symbol table, providing valuable information about the current global variables in a program. In this article, ... Read More

Group Elements in Matrix using Python

Rohan Singh

Rohan Singh

Updated on 17-Jul-2023 17:58:37

180 Views

Matrices are widely used in various fields, including mathematics, physics, and computer science. In some situations, we need to group elements of the matrix based on certain criteria. We can group elements of the matrix by row, column, values, condition, etc. In this article, we will understand how we can ... Read More

Get Random Range Average using Python

Rohan Singh

Rohan Singh

Updated on 17-Jul-2023 17:12:22

452 Views

Python provides a robust set of tools and libraries to generate random numbers within a specific range and calculate their average. We can use the Numpy library, statistics module, random module, and random.choice function etc to Randomly generate numbers within a range and find their average. In this article, we ... Read More

How to resample a NumPy array representing an image?

Rohan Singh

Rohan Singh

Updated on 11-Jul-2023 14:48:51

1K+ Views

Resampling a Numpy array representing an image is the process of changing the size of the array while maintaining the quality of the image. We can resample an array using interpolation, decimation, and upsampling techniques in Python. We can use the ndimage.zoom() function for Scipy library in Python to resample ... Read More

How to reshape Pandas Series?

Rohan Singh

Rohan Singh

Updated on 11-Jul-2023 14:45:12

2K+ Views

We can reshape the Pandas series using ways like Transpose, reshape method, and melt function. A Pandas Series is a one-dimensional labeled array that can hold data of any type (integer, float, string, etc.). It is similar to a NumPy array but has an index associated with each element that ... Read More

How to Retrieve an Entire Row or Column of an Array in Python?

Rohan Singh

Rohan Singh

Updated on 11-Jul-2023 14:41:44

4K+ Views

Python provides various in-built methods to retrieve an entire row or column of an array. We can use the Slice notation method, Numpy Library, list comprehension, and for loop to retrieve the entire row or column of an array. In this article, we will explore all the methods with examples ... Read More

Python Program to Splitting String into a Number of Sub-strings

Rohan Singh

Rohan Singh

Updated on 11-Jul-2023 14:38:21

107 Views

In Python, we can split a string into substrings using the split() method. The split() method is one of the built-in Python string methods that splits a string into a list of substrings based on a specified delimiter. In this article, we will learn how to split strings into substrings ... Read More

Previous 1 ... 7 8 9 10 11 ... 18 Next
Advertisements