Spaces:
Runtime error
Runtime error
Tyler Burns
commited on
Commit
•
8a8f76b
1
Parent(s):
ff51de8
fixed keyword block
Browse files
app.py
CHANGED
@@ -70,10 +70,15 @@ for i in np.unique(dat['cluster']):
|
|
70 |
keywords_df.append(TR_keywords[0:10])
|
71 |
|
72 |
keywords_df = pd.DataFrame(keywords_df)
|
73 |
-
keywords_df
|
|
|
|
|
|
|
|
|
|
|
74 |
|
75 |
# Merge the data together
|
76 |
-
dat = pd.concat([md.reset_index(), dimr.reset_index()
|
77 |
|
78 |
# handle duplicate index columns
|
79 |
dat = dat.loc[:,~dat.columns.duplicated()]
|
|
|
70 |
keywords_df.append(TR_keywords[0:10])
|
71 |
|
72 |
keywords_df = pd.DataFrame(keywords_df)
|
73 |
+
keywords_df['cluster'] = np.unique(dimr['cluster'])
|
74 |
+
keywords_df.columns = ['keyword1', 'keyword2', 'keyword3', 'keyword4', 'keyword5', 'cluster']
|
75 |
+
|
76 |
+
# Get the keyword data into the dataframe
|
77 |
+
dat = dat.merge(keywords_df) # This messes up the index, so we need to reset it
|
78 |
+
dat = dat.reset_index(drop = True)
|
79 |
|
80 |
# Merge the data together
|
81 |
+
dat = pd.concat([md.reset_index(), dimr.reset_index()], axis = 1)
|
82 |
|
83 |
# handle duplicate index columns
|
84 |
dat = dat.loc[:,~dat.columns.duplicated()]
|