I am familiar with basic concepts of reading and writing a csv file in python. But I am stuck to make a logic for this problem. I think GROUP BY can solve my problem but how one can do in python
Category Data
A Once upon a time.
A There was a king.
A who ruled a great and glorious nation.
B He loved each of them dearly.
B One day, when the young ladies were of age to be married.
B terrible, three-headed dragon laid.
C It is so difficult to deny
C the reality
I want to make logic for such an output that data with category A merges to one row and same for category B and C like this.
Category Data
A Once upon a time. There was a king. who ruled a great and glorious nation.
B He loved each of them dearly. One day, when the young ladies were of age to be married. terrible, three-headed dragon laid.
C It is so difficult to deny the reality
Please if anyone of you can help me out with this logic I would appreciate his effort.
groupby: docs.python.org/2/library/itertools.html#itertools.groupby, to group on thecategory. Use that to concatenate the data, and create a new csv.