import pandas as pd import numpy as np from tkinter import * from tkinter import filedialog root = Tk()#创建一个窗口 root.title('数据集处理窗口')#给窗口命名 root.geometry('2000x1000')#设置窗口的大小 lb1 =Label(root, text='选择数据集')#root是主体,text是内容 lb1.place(relx=0.1, rely=0.1, relwidth=0.8, relheight=0.1)#设置位置 def openfile():#打开文件并显示 openfile = filedialog.askopenfilename() #获得选择好的文件,单个文件 imgtype=['.csv']#规定读取的文件类型 return openfile def duru(txt): txt=pd.read_csv(txt,engine='python') txt=txt.describe() text = Text(root) text.place(rely=0.6, relheight=0.4) text.insert(END, txt) 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)

缺失值检测内容:

def qsjc(txt): txt=pd.read_csv(txt,engine='python') isnull=txt.isnull().sum()#统计每一列的缺失值数量 text = Text(root) text.place(rely=0.6, relheight=0.4) text.insert(END, isnull)

Python 数据集处理工具:缺失值处理、描述性统计

原文地址: https://www.cveoy.top/t/topic/okLK 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录