I want to remove duplicates from each row in a two dimensional list. The list is entered by a user and consists of words.
I wrote a code for removing dublicates from a 1D array like this:
from math import *
inputlist = [(x) for x in input("\nInput words separated with comma:\n").split(', ')]
remove_duplicate = tuple(set(inputlist))
print(f'\nTupel:\n {remove_duplicate}')
And then another code for entering two dimensional list:
from math import *
import numpy as np
m = int(input("rows: ")) # rows
n = int(input("columns: ")) # columns
print("\nEneter words:\n")
twodlist = []
for i in range(0,m):
twodlist.append([])
for j in range(0,n):
twodlist[i].append(0)
twodlist[i][j] = (input())
But I don't know how to combine the codes so I get the results I want. I don't want the duplicates removed by columns but only by rows.