conditional List comprehension (not equal to)

209 views Asked by At

I have a quick question, can someone tell me why this is not working? -.-"

The point is to look through a the column "Owned by Team" filter out all the unique teams and then input them as a drop down menu in Tkinter.

Unfortunately at the moment I am getting an empty list.

teams = [user for user in df['Owned By Team'] if user != user]

when I do it differently it does give me the one result but nothing else

#read data
excel = 'export.xlsx'
data = pd.read_excel(excel, parse_dates=['Closed Date Time'])
df = pd.DataFrame(data)

root = Tk()
root.title("Graph by Team")
root.geometry('400x200')

teams = [user for user in df['Owned By Team']]
team = list(set(teams))

clicked = StringVar()

# Drop Down Box
drop = OptionMenu(root, clicked, *team)
drop.pack()

newGraph = Button(root, text='Show graph', command=graph)
newGraph.pack()

print(team)

root.mainloop()
0

There are 0 answers