I have a quick question. I am trying to convert dataframe to different dataframe. Would it be possible if you can help me? I am showing the input and output as follow? My current dataframe described as input and what i want to see is in output. Please see it is in enter image description here
Asked
Active
Viewed 32 times
0
-
Hi. Please post your dataframe input and output as text, not as image. It will be easier for us to help you. – LCMa Oct 29 '20 at 15:08
-
[Pandas101](https://pandas.pydata.org/pandas-docs/stable/user_guide/reshaping.html) has an entire section dedicated to data reshaping and pivoting. What have you tried? Why did it fail? – Mr. T Oct 29 '20 at 15:15
1 Answers
0
Possibly very simple with a pivot table:
df.pivot_table(index='date_year', columns='name')

JBernardo
- 32,262
- 10
- 90
- 115