Python Forum
[PyQt] Help with PyQt5
Thread Rating:
  • 1 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[PyQt] Help with PyQt5
#1
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:

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.
Reply


Messages In This Thread
Help with PyQt5 - by PVfan - May-23-2018, 01:59 PM
RE: Help with PyQt5 - by Alfalfa - Jun-26-2018, 01:19 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Huge code problems (buttons(PyQt5),PyQt5 Threads, Windows etc) ZenWoR 0 2,862 Apr-06-2019, 11:15 PM
Last Post: ZenWoR

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020