Hello, I'm having the following difficulty, because I'm working with numpy now, I'm inexperienced ...
Well, my problem is this: I have a tuple (w, t), where t repeats, so I want to add t as lines, but specifically in the first row of the array, then I want to check which tuples have the t and add the column it belongs to, it would look like this:
[ t1 , t2 ...
(w1, t1) , (w2, t2), ...
.
.
.
]
so that t will always be added in the first row on the x-axis, and the w's in the columns on the y-axis.
So, how could you do that?
I've seen the issue shape , but I can not quite understand it. I tried np.append (array, value, axis) , changing the value of axis from 0 to 1, but did not work.
Example input:
[('São', 'V'), ('Paulo', 'NPROP'), ('18', 'N'), ('de', 'PREP'), ('julho', 'N'), ('de', 'PREP'), ('1988', 'N'), ('Edu', 'NPROP')]...
A list with tuples ... in the case I wanted to remove the duplicity of the value from the right tuple by putting it as a column, and the values from the left would be inside a list in its respective column.
Output:
[ 'V' , 'NPROP', 'N', 'PREP'
['São'], ['Paulo', 'Edu'], ['18', '1988'], ['de', 'de']
]