Generation

generate functionFri, 03 Feb 2023

generate a unique id for each line of the pandas dataframe

def get_id(x): return x['user_id'] + '_' + x['item_id'] df['id'] = df.apply(get_id, axis=1)

Want to kickstart your project?Use the new AI Studio to create your code