While working with Python Matrix, we can face a problem in which we need to perform the removal of duplicates from Matrix. This problem can occur in Machine Learning domain because of extensive usage of matrices. Let’s discuss certain way in which this task can be performed.
Method : Using loop
This task can be performed in brute force manner using loops. In this, we just iterate the list of list using loop and check for the already presence of element, and append in case it’s new element, and construct a non-duplicate matrix.
The original list is : [[5, 6, 8], [8, 5, 3], [9, 10, 3]] The Matrix after duplicates removal is : [[5, 6, 8], , [9, 10]]
- Python | Remove Duplicates from a List
- Remove all duplicates from a given string in Python
- Python | Ways to remove duplicates from list
- Python | Remove duplicates from nested list
- Python | Remove all duplicates words from a given sentence
- Python | Remove consecutive duplicates from list
- Python groupby method to remove all consecutive duplicates
- Python | Remove all duplicates and permutations in nested list
- Python | Sort given list by frequency and remove duplicates
- Python | Remove False row from matrix
- Python | Difference of two lists including duplicates
- Python | Program to count duplicates in a list of tuples
- Python | Consecutive duplicates all elements deletion in list
- Python | Program to print duplicates from a list of integers
- Python | Combine two lists by maintaining duplicates in first list
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.