title: Python: How to create a new dataframe conditional sum two columns?
body: <p>I have a data frame where each row represents a user's time spent on a unique issue for a month. I want to create a new data frame to group by user id, showing for each user, 1)how many issues they have opened and 2)how many issues they have spent more than 60 minutes, 3)dividing 2)by 1) and export the 4 columns to excel. I was able to get the total issues per person opened however having trouble getting the other ones.</p>
  <p>Original data frame:  Issue ID,  User ID, Time Taken</p>
  <p>Code used to get total issue opened per user:  df.groupby('User ID')['Issue ID'].nunique()</p>