如何使用python熊猫删除列索引?

时间:2020-06-24 05:32:00

标签: python pandas dataframe

我想删除在组合框中显示为值的列索引。 这是我的组合框现在的样子:

(其中显示的所有数字均为列索引)

从组合框图像中可以看到,它非常混乱。

combobox

输出应为:

output

数据样本:

data

df = pd.read_excel ('N:/TEST/TEST UTILIZATION/IA 2020/Dev/SCS-FT-IE-Report.xlsm', sheet_name= 'FT')
df.sort_values("Customer Name", inplace = True) 
df.drop_duplicates(subset ="Customer Name", inplace = True)
df3 = pd.DataFrame(df, columns = ["Customer Name"])
df3.style.hide_index()

comboExample = ttk.Combobox(window, width=40, values=df3, state="readonly")
comboExample.current(0)
comboExample.grid(column=2, row=2)

我尝试使用df.reset_indexdf.style.hide_index,但是它不起作用。关于如何解决这个问题有什么想法吗?

谢谢大家的帮助! :-)

0 个答案:

没有答案