May-23-2018, 01:59 PM
Hi to all,
I am new in Python and i would be very pleased if you would help me.
I have a code in Python (i use spyder(python 3.6)), that read excel files, find the blank values, find their location in the excel file and it creates a new dataframe with specific information of the blank values.
Now, i want to create a GUI, in which i present the dataframe. Ideally, i want a GUI, that opening a window asking me the name of the excel file that i want to open, press a button and running the code about blank values that i have created and display the dataframe in a decent way (maybe a tree).
I have searched 2 days on the internet, but I am so confused.
I want someone helps me to import this code in a GUI, and run it through the GUI.
I have read about classes, models etc but i am confused.
I attach my code below:
I am new in Python and i would be very pleased if you would help me.
I have a code in Python (i use spyder(python 3.6)), that read excel files, find the blank values, find their location in the excel file and it creates a new dataframe with specific information of the blank values.
Now, i want to create a GUI, in which i present the dataframe. Ideally, i want a GUI, that opening a window asking me the name of the excel file that i want to open, press a button and running the code about blank values that i have created and display the dataframe in a decent way (maybe a tree).
I have searched 2 days on the internet, but I am so confused.
I want someone helps me to import this code in a GUI, and run it through the GUI.
I have read about classes, models etc but i am confused.
I attach my code below:
import pandas as pd import numpy as np xls=pd.ExcelFile('name.xlsx') df1=pd.read_excel(xls,'name_1') df2=pd.read_excel(xls,'name_2') find_the_blanks=[] blank_values=np.where(pd.isnull(df1)) blank_values_1=[blank_values[0]] blank_values_2=[blank_values[1]] a=list(zip(*blank_values_2,*blank_values_1)) a.sort(key=lambda x: x[0]) b=list(zip(*a)) k=0 i=0 find_the_blanks.append([]) for i in range(len(b[0])): if (b[0][i]==b[0][i-1]): find_the_blanks[k].append(df1.iloc[b[1][i],0]) else: k=k+1 find_the_blanks.append([]) find_the_blanks[k].append(df1.iloc[0,b[0][i]]) find_the_blanks[k].append(df1.iloc[b[1][i],0]) print(find_the_blanks) df=pd.DataFrame(find_the_blanks) df=df.transpose() df.drop(df.columns[[0]], axis=1, inplace=True)I want to apologise for my poor English level. Thank you so much in advance.