- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 10784 Articles for Python
![Rohan Singh](https://www.tutorialspoint.com/assets/profiles/638564/profile/60_146647-1681360804.jpg)
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 methods to obtain the indices of uppercase characters in a given string. Method 1:Using List Comprehension Using list comprehension we can iterate through the characters of a string, check if they are uppercase using the isupper() method, and stores their indices in a list. It provides a concise and ... Read More
![Tapas Kumar Ghosh](https://www.tutorialspoint.com/assets/profiles/641996/profile/60_877006-1681905500.jpg)
277 Views
Python dictionary is one of the most popular data types among the following 4 datatypes. The dictionary defines the key with value pair and doesn’t allow the duplicate. The values are either strings or integers. Sometimes, while working on the dictionary it has some empty values that the None value can fill. For example- when we are working on a machine learning dataset it has found that some of the rows are empty and can be filled by the value None when performing the particular task. In Python, we have some built-in functions like items() and lambda that can be ... Read More
![Tapas Kumar Ghosh](https://www.tutorialspoint.com/assets/profiles/641996/profile/60_877006-1681905500.jpg)
541 Views
The term prefix is defined by the beginning of the word or letter. In this article, we will learn how to use Python built-in functions like startswith(), filter(), lambda, and len() to Filter list elements starting with a given Prefix using Python. Let’s take an example to understand this − Let’s take an example to understand this: Given element list, My_list = [“Amelia”, “Kinshuk”, “Rosy”, “Aman”] Keyword to be searched, Prefix = “Am” Final result = [“Amelia”, “Aman”] Syntax The following syntax is used in all the examples − startswith() The is a built-in ... Read More
![Tapas Kumar Ghosh](https://www.tutorialspoint.com/assets/profiles/641996/profile/60_877006-1681905500.jpg)
527 Views
The dictionary is a popular data type in Python that has a key with value pair and doesn’t allow duplicates. To filter the odd elements it has some built-in functions like items(), filter(), lambda, and, the list() will be used to Filter odd elements from value lists in the dictionary. The odd elements of the list are those elements that are not divisible by 2. For example − The given list, [10, 22, 21, 19, 2, 5] After filtering the odd elements from the list: The final result becomes [10, 22, 2] (These are the elements that are divisible by ... Read More
![Tapas Kumar Ghosh](https://www.tutorialspoint.com/assets/profiles/641996/profile/60_877006-1681905500.jpg)
332 Views
A range length is defined by representing range of values that follow the start and end point along with the length. In Python, there are some built-in functions like list(), append(), filter(), and, lambda which can be used to solve the problem based on Filter Range Length Tuples. This type of problem statement normally helps to build the logic of filtering tool. Syntax The following syntax is used in the examples − len() The len() is the built-in method in Python that returns the length of the object. append() The append method in Python is used to add ... Read More
![Tapas Kumar Ghosh](https://www.tutorialspoint.com/assets/profiles/641996/profile/60_877006-1681905500.jpg)
321 Views
The matrix is defined by arranging rows and columns to form an array. The values of a matrix in rows and columns either be characters or integers. There are various method names- dictionary comprehension, for loop, enumerate, and, zip() that will be used to Convert a Matrix to a Dictionary in Python. Using a for Loop and Dictionary Comprehension The program uses the for loop that will iterate the length of the matrix by applying dictionary comprehension. This helps the conversion of the matrix into a dictionary. Example In the following example, we will show the name values of matrix ... Read More
![Tapas Kumar Ghosh](https://www.tutorialspoint.com/assets/profiles/641996/profile/60_877006-1681905500.jpg)
1K+ Views
The snake case string is the naming convention where words are instead separated by an underscore(‘-’). The Camel case is defined by two or more words connected together without spaces and the first letter of each word being capitalized. There are various built-in methods in Python such as split(), join(), and, re.sub() that can be used to convert Snake Case String to Camel Case using Python. Let’s take an example of this − Snake Case String − hello_world(having separator i.e. underscore ‘_’) Camel Case String − helloWorld(when we convert the Snake case into Camel case it allows the second ... Read More
![Tapas Kumar Ghosh](https://www.tutorialspoint.com/assets/profiles/641996/profile/60_877006-1681905500.jpg)
457 Views
The list is defined by an ordered sequence of elements whereas the nested dictionary defines the dictionary include another dictionary. The nested dictionary is required when we want to store large data in a big dictionary. In Python, we have some built-in functions like reduce() and zip() that Convert Lists into Nested Dictionary. For example- Dictionary data communicate the structural content of data which is easier to understand. Syntax The following syntax is used in the examples − reduce() This built-in function in Python follows the functools module to perform a specific operation on lists. zip() The zip() ... Read More
![Tapas Kumar Ghosh](https://www.tutorialspoint.com/assets/profiles/641996/profile/60_877006-1681905500.jpg)
775 Views
The dataframe in PySpark is defined by a shared collection of data that can be used to run in computer machines and structurize the data into rows and columns format. The range of rows defines a horizontal line(set of multiple values according to condition) in the dataset. In general, the range sets the lowest and highest values. In Python, we have some built-in functions like filter(), where(), and, collect() to select a range of rows from a dataframe in PySpark. Syntax The following syntax is used in the examples − createDataFrame() This is a built-in method in Python ... Read More
![Tapas Kumar Ghosh](https://www.tutorialspoint.com/assets/profiles/641996/profile/60_877006-1681905500.jpg)
587 Views
PySpark dataframe is defined as a collection of distributed data that can be used in different machines and generate the structure data into a named column. The term slice is normally used to represent the partitioning of data. In Python, we have some built-in functions like limit(), collect(), exceptAll(), etc that can be used to slice a PySpark dataframe in two row-wise dataframe. Syntax The following syntax is used in the examples − limit() This is a built-in method in Python that can be used to set the range of rows by specifying the integer value. subtract() The ... Read More