Generation

generate functionFri, 03 Feb 2023

generate a unique id for each line of the pandas dataframe

def gen_id(row): return str(row.id) + '-' + str(row.hour) df['id'] = df.apply(gen_id, axis=1)

Questions about programming?Chat with your personal AI assistant