Duplicate items, turn number input into dropdown to choose

PHOTO EMBED

Thu Jan 19 2023 21:20:47 GMT+0000 (Coordinated Universal Time)

Saved by @tofufu #python

""" Look for duplicate materials and let user choose between 2 pulled values from the same material

    Arguments:
       pandas_database {pandas object} -- original items database, pandas
       selected_material {string} -- selected items from dropdown input
       readable_excel_database {Excel object} -- Excel object to be able to read from Excel sheet
       data_column {string} -- column name to extract value for selected item

    Returns:
       list -- return list of extracted values from Excel
"""
    
# find the "duplicate" items
item_matches_indices = [j for j, x in enumerate(list(pandas_database[0])) if x == selected_item]

# extract and save the respective values
matched_items_values = []
for index in material_matches_indices:
   matched_items_values.append(readable_excel_database[data_column][index])
content_copyCOPY