1
Hello, I am having the following difficulty, this because I am working with numpy now, I am inexperienced...
Well my problem is this, I have a tuple (w, t), and the t repeats itself, so that I want to add the t as lines, but specifically in the first line of the array, then I want to check which tuples have the t equal and add w to the column it belongs to, would look like this:
[ t1 , t2 ...
(w1, t1) , (w2, t2), ...
.
.
.
]
so that t will always be added on the first row on the x axis, and w on the columns, on the y axis.
then how could I do it?
I’ve seen the question Shape, But I don’t understand it very well. I tried the np.append(array, value, Axis), changing the value of Axis 0 to 1, but it didn’t work.
Input example:
[('São', 'V'), ('Paulo', 'NPROP'), ('18', 'N'), ('de', 'PREP'), ('julho', 'N'), ('de', 'PREP'), ('1988', 'N'), ('Edu', 'NPROP')]...
a list with tuples... in case I wanted to remove the duplicity of the value of the tuple to the right placing it as column, and the values of the left would be inside a list in its respective column.
Exit:
[ 'V' , 'NPROP', 'N', 'PREP'
['São'], ['Paulo', 'Edu'], ['18', '1988'], ['de', 'de']
]
You could include an example of input and its expected output ?
– Lacobus
@Lacobus I changed the question... tell me if you have given of enteder!
– Nayron Morais
And what the exit would look like ?
– Lacobus
@Lacobus Pronto!
– Nayron Morais