I have a pandas dataframe with three columns, say : A,B,C and I would like to rearrange the data and ouput it in a CSV so that all values in C that have the same value in A share a row. So for example if my Code block is designed as follows (for example, not that I'd design it this way):'
check=pd.DataFrame(columns=['A','B', 'C'])
for i in range(8):
check.loc[1]=[1,11,10]
check.loc[2]=[1,21,23]
check.loc[3]=[1,23,32]
check.loc[4]=[2,21,41]
check.loc[5]=[2,21,11]
check.loc[6]=[3,21,29]
check.loc[7]=[4,21,43]
check.loc[8]=[4,21,52]
` I'd want the output to look like one of the following in the CSV: This:
1,,,
10,23,32,
2,,,
41,11,,
3,,,
29,,,
4,,,
43,52,,
OR:
1,10,23,32
2,41,11,
3,29,,
4,43,52,
OR:
10,23,32,
41,11,,
29,,,
43,52,,
Thank you in advance for any suggestions.