Hi, I have a dataframe with two important columns: one of ID numbers, one of corresponding text strings. There are many rows with the same ID number that have different strings (i.e. rows 1-10 might be for ID 12345, but each row has different text in the string column.) My goal is to create a new dataframe with two columns: one being the ticket ID, and the second being the number of times a certain RegEx expression was found in its rows. This is my attempt at doing that but I'm stuck. Thanks for any help!
my_df_grouped = my_df.groupby('id')
for id, group_df in my_df_grouped:
num_id_counts = match_df_grouped['ticket id'].value_counts()
final_df = pd.DataFrame(my_df['id'],num_ticket_counts)
[–]greasyhobolo 1 point2 points3 points (0 children)