Skip to content

panda data frame represent using CTkTable #45

Answered by rakib06
sahansandaruwan asked this question in Q&A
Discussion options

You must be logged in to vote
df = pd.read_csv(csv_file_name)
value = []

v = ['sl']
v.extend(df.columns)
value.append(v)
for i, row in df.iterrows():
    value.append([i]+list(row))

print(value)
    
table = CTkTable(master=self.root, row=10 if len(value)>10 else len(value) , column=len(value[0]), values=value)
table.pack(expand=True, fill="both", padx=20, pady=20)```

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by sahansandaruwan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants