I have csv dataset as :
5.1,3.5,1.4,0.2,Iris-setosa
7.0,3.2,4.7,1.4,Iris-versicolor
6.3,3.3,6.0,2.5,Iris-virginica
4.9,3.0,1.4,0.2,Iris-setosa
4.7,3.2,1.3,0.2,Iris-setosa
4.4,2.9,1.4,0.2,Iris-setosa
5.1,2.5,3.0,1.1,Iris-versicolor
5.7,2.8,4.1,1.3,Iris-versicolor
5.8,2.7,5.1,1.9,Iris-virginica
7.1,3.0,5.9,2.1,Iris-virginica
6.3,2.9,5.6,1.8,Iris-virginica
I want to have it as:
Iris-setosa,Iris-versicolor,Iris-virginica
5.1,3.5,1.4,
7.0,3.2,4.7,
6.3,3.3,6.0,
4.9,3.0,1.4,
4.7,3.2,1.3
I searched and there are lot of answers like using pd.pivot but failed to have desired output. When I tried giving some index A to pivot, it thorw 'index has duplicate entries'. If answer contains .pivot function, then can you please explain me what actually index, column and values are.