import pandas as pd import numpy as npfrom tkinter import from tkinter import filedialogroot = Tk#创建一个窗口roottitle数据集处理窗口#给窗口命名rootgeometry2000x1000#设置窗口的大小lb1 =Labelroot text=选择数据集#root是主体text是内容lb1pl
def queshizhi(txt): txt=pd.read_csv(txt,engine='python') txt=txt.fillna(method='ffill')#用前一个非空值填充缺失值 text = Text(root) text.place(rely=0.6, relheight=0.4) text.insert(END, txt) b1 = Button(root, text="打开文件", command=lambda:duru(openfile()))#调用duru函数来打开文件并显示 b1.place(relx=0.1, rely=0.3, relwidth=0.2, relheight=0.1)#设置位置
b2 = Button(root, text="缺失值处理", command=lambda:queshizhi(openfile()))#调用queshizhi函数来处理缺失值 b2.place(relx=0.4, rely=0.3, relwidth=0.2, relheight=0.1)#设置位置
root.mainloop()#窗口的主事件循环。必须在程序中至少出现一次,用于等待并接收来自用户的事件
原文地址: https://www.cveoy.top/t/topic/fnSv 著作权归作者所有。请勿转载和采集!