News for hackers. Stuff that matters.
Re:What would it take to recreate dplyr in Python? (2020) by armanboyaci on Monday January 17, 2022 @02:23PM (#29970627)
I am distracted with the example provided in the post. I am pretty sure that most pandas users will just put course_ids on the columns. I mean the shape of the user_courses dataframe is not suitable for the task.

  (user_courses
     .set_index(["student_id", 
                 "course_id"])
     .unstack()
     .apply(lambda x: x+1))

There are no comments on this comment yet.