3
I have this table and would like to put together a list or another table
     users_ID_User                                           Material  Rating
0            A            "Hey Pogo!...from citation to fulltext"       5
1            B            "Hey Pogo!...from citation to fulltext"       4
2            C            "Hey Pogo!...from citation to fulltext"       5
3            D            "Hey Pogo!...from citation to fulltext"       4
4            D              "Julius Caesar" Speech Analysis StAIR       4
5            A              "Julius Caesar" Speech Analysis StAIR       4
6            B              "Julius Caesar" Speech Analysis StAIR       4
7            E              "Julius Caesar" Speech Analysis StAIR       4
8            E  "Virgin Birth" method promises ethical stem cells       5
9             A  "Virgin Birth" method promises ethical stem cells       3
10             D                   .NET Overview, VB.NET and C#.NET       5
11            C                   .NET Overview, VB.NET and C#.NET       4
12            D  1 Project Management and Software Engineering ...       4
13             A  1 Project Management and Software Engineering ...       4
14             S  1 Project Management and Software Engineering ...       4
15             B  1 Project Management and Software Engineering ...       4
16            A  1 Project Management and Software Engineering ...       4
17           C                       10 Best Foods 10 Worst Foods       1
18             D                       10 Best Foods 10 Worst Foods       2
19           E                       10 Best Foods 10 Worst Foods       4
20           E                           100 preguntas de química       0
21           F                           100 preguntas de química       0
22           G                           100 preguntas de química       0
23           A                           100 preguntas de química       2
24           B                           100 preguntas de química       0
25           C                           100 preguntas de química       4
26           E                           100 preguntas de química       5
27           A                           100 preguntas de química       4
28           F                           1000 Quick Writing Ideas       2
29           A                           1000 Quick Writing Ideas       0
I’m using pandas, I tried:
df_3 = pd.read_csv("tabela_final_1.csv",delimiter=",")
del df_3['Unnamed: 0']
df_3 = df_3.drop_duplicates(['users_ID_User','Material'])
df_3 = df_3.pivot('users_ID_User','Material','Rating')
didn’t work out the way I’d like, I’m trying to ride.
Usuario   Hey Pogo !...       Julius Caesar ...  Virgin Birth ... 
A                     5           4
B                     4           4
C                     6           NaN
D                     4           NaN
E                     NaN          5                    5
and in the end sort by the line that has the most the rating...
in the case shown would be first A, B, E ......
I would like a logic to put together this table, I’m a little confused!