def __init__(self, parent=None): self.parent = parent Frame.__init__(self) self.main = self.master self.main.geometry('600x400+200+100') self.main.title('Table app') f = Frame(self.main) f.pack(fill=BOTH, expand=1) df = TableModel.getSampleData() self.table = pt = Table(f, dataframe=df, showtoolbar=True, showstatusbar=True) pt.show() return
def smmm(u): #f.grid(row=15,column=0,sticky=W,ipadx=600,ipady=17) df = TableModel.getSampleData() pt = Table(leftFrame2,dataframe=u,showtoolbar=True, showstatusbar=True) pt.grid(row=15,column=0,sticky=W,ipadx=345,ipady=17) pt.show()
def __init__(self, parent=None): window = Toplevel(chirag) f = Frame(window) f.pack(fill=BOTH,expand=1) df = TableModel.getSampleData() table = pt = Table(f, dataframe=df,showtoolbar=True, showstatusbar=True) pt.importCSV(chirag.filename) pt.show() return
def __init__(self, passed_dataframe=TableModel.getSampleData(), parent=None): self.is_showing = True self.parent = parent tk.Frame.__init__(self) self.main = tk.Toplevel(parent) self.main.geometry('1000x400+200+100') self.main.title('My Trades Table') self.main.protocol('WM_DELETE_WINDOW', self.on_closing) f = tk.Frame(self.main) f.pack(fill=tk.BOTH, expand=1) df = passed_dataframe self.table = pt = Table(f, dataframe=df, showtoolbar=True, showstatusbar=True) pt.show() return
def __init__(self, parent, controller): from tkinter import ttk tk.Frame.__init__(self, parent) s=str("Month: "+m+" and Weather Condition: "+c+".") from pandastable import Table, TableModel lbl=tk.Label(self, text=s, font=("Arial Bold", 18)) lbl.grid(row=0, column=1) f = Frame(self) f.grid(row=2, column=0, columnspan=3) df = TableModel.getSampleData() print(type(df)) self.table = pt = Table(f, dataframe=df1, showtoolbar=True, showstatusbar=True) pt.show() btn122=tk.Button(self, text="Back", command=lambda : controller.show_frame(pageone)) btn122.grid(row=0, column=0) btn122=tk.Button(self, text='Go to Home', command=lambda : controller.show_frame(startpage)) btn122.grid(row=3, column=1) label=tk.Label(self, text=txt) label.grid(row=1, column=0, columnspan=4)
def test(self): path = 'test_batch' for i in range(20): df = TableModel.getSampleData() df.to_csv(os.path.join(path, 'test%s.csv' % str(i))) return
from tkinter import Tk, Frame from pandastable import Table, TableModel data = { 'rec1': { 'col1': 99.88, 'col2': 108.79, 'label': 'rec1' }, 'rec2': { 'col1': 99.88, 'col2': 108.79, 'label': 'rec2' } } root = Tk() f = Frame(root) f.pack(fill="both", expand=1) model = TableModel.getSampleData() table = Table(f, dataframe=model, showtoolbar=True, showstatusbar=True) table.show() table.showPlotViewer(layout='horizontal') #table.showPlot() root.mainloop()
def run(): print(dirname) mypath = (dirname) onlyfiles = [ os.path.join(mypath, f) for f in os.listdir(mypath) if os.path.isfile(os.path.join(mypath, f)) ] def pdfextract(file): text = extract_text(file) return text #function that does phrase matching and builds a candidate profile def create_profile(file): text = pdfextract(file) text = str(text) text = text.replace("\\n", "") text = text.lower() #below is the csv where we have all the keywords, you can customize your own keyword_dict = pd.read_csv( 'https://raw.githubusercontent.com/darvinloganathan/resume-pharse/main/template.csv', error_bad_lines=False) stats_words = [ nlp(text) for text in keyword_dict['Statistics'].dropna(axis=0) ] NLP_words = [nlp(text) for text in keyword_dict['NLP'].dropna(axis=0)] ML_words = [ nlp(text) for text in keyword_dict['Machine Learning'].dropna(axis=0) ] DL_words = [ nlp(text) for text in keyword_dict['Deep Learning'].dropna(axis=0) ] R_words = [ nlp(text) for text in keyword_dict['R Language'].dropna(axis=0) ] python_words = [ nlp(text) for text in keyword_dict['Python Language'].dropna(axis=0) ] Data_Engineering_words = [ nlp(text) for text in keyword_dict['Data Engineering'].dropna(axis=0) ] matcher = PhraseMatcher(nlp.vocab) matcher.add('Statstics', None, *stats_words) matcher.add('NLP', None, *NLP_words) matcher.add('MachineLearnig', None, *ML_words) matcher.add('DeepLearning', None, *DL_words) matcher.add('R', None, *R_words) matcher.add('Python', None, *python_words) matcher.add('DataEngineering', None, *Data_Engineering_words) doc = nlp(text) d = [] matches = matcher(doc) for match_id, start, end in matches: rule_id = nlp.vocab.strings[ match_id] # get the unicode ID, i.e. 'COLOR' span = doc[start:end] # get the matched slice of the doc d.append((rule_id, span.text)) keywords = "\n".join(f'{i[0]} {i[1]} ({j})' for i, j in Counter(d).items()) ## convertimg string of keywords to dataframe df = pd.read_csv(StringIO(keywords), names=['Keywords_List']) df1 = pd.DataFrame(df.Keywords_List.str.split(' ', 1).tolist(), columns=['Subject', 'Keyword']) df2 = pd.DataFrame(df1.Keyword.str.split('(', 1).tolist(), columns=['Keyword', 'Count']) df3 = pd.concat([df1['Subject'], df2['Keyword'], df2['Count']], axis=1) df3['Count'] = df3['Count'].apply(lambda x: x.rstrip(")")) base = os.path.basename(file) filename = os.path.splitext(base)[0] name = filename.split('_') name2 = name[0] name2 = name2.lower() ## converting str to dataframe name3 = pd.read_csv(StringIO(name2), names=['Candidate Name']) dataf = pd.concat([ name3['Candidate Name'], df3['Subject'], df3['Keyword'], df3['Count'] ], axis=1) dataf['Candidate Name'].fillna(dataf['Candidate Name'].iloc[0], inplace=True) return (dataf) #function ends #code to execute/call the above functions final_database = pd.DataFrame() i = 0 while i < len(onlyfiles): file = onlyfiles[i] dat = create_profile(file) final_database = final_database.append(dat) i += 1 print(final_database) #code to count words under each category and visulaize it through Matplotlib final_database2 = final_database['Keyword'].groupby( [final_database['Candidate Name'], final_database['Subject']]).count().unstack() final_database2.reset_index(inplace=True) final_database2.fillna(0, inplace=True) new_data = final_database2.iloc[:, 1:] new_data.index = final_database2['Candidate Name'] new_data['Score'] = new_data.sum(axis=1, skipna=True) result = new_data result.reset_index(level=0, inplace=True) # base=list(result['Candidate Name']) # result['resume'] = np.array(base) total_exp = [] mail_id = [] mob_num = [] for i in onlyfiles: data = ResumeParser(i).get_extracted_data() a = data['total_experience'] b = data['email'] c = data['mobile_number'] total_exp.append(a) mail_id.append(b) mob_num.append(c) te = [] for i in total_exp: if i > 0: te.append(i) else: te.append('fresher') result.loc[:, 'total_experience'] = pd.Series(te) result.loc[:, 'email'] = pd.Series(mail_id) result.loc[:, 'mobile_number'] = pd.Series(mob_num) result1 = result.sort_values(by='Score', ascending=False) df = TableModel.getSampleData() table = pt = Table(Top, dataframe=result1, showtoolbar=True, showstatusbar=True) pt.show()