[![enter image description here](https://i.stack.imgur.com/cIJuI.png)](https://i.stack.imgur.com/cIJuI.png)

I have a dataframe with tag as column and movieId as index. movieId represents movies.
So there may be multiple tags for the same movieId.

I want to transform this dataframe and there are as many columns as there are tags and that moviesId become the lines but there must be one line per movieId.
And that for each movieId if there was a tag there is a 1 in the tag column at otherwise 0

I can't do it when I try, the moviesID appear several times.

Would someone help me

Thank you so much.