Skip to content

Commit 16da8d7

Browse files
committed
Updated minor functionalities
1 parent 19d56da commit 16da8d7

File tree

1 file changed

+19
-7
lines changed

1 file changed

+19
-7
lines changed

textmining_python.ipynb

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1207,8 +1207,8 @@
12071207
}
12081208
],
12091209
"source": [
1210-
"import os\n",
1211-
"os.listdir() #Allows us to check the files in the current directory, if folktales.csv is not here, then we need to give the path"
1210+
"import glob\n",
1211+
"glob.glob(\"*.csv\") #Allows us to check the files in the current directory, if folktales.csv is not here, then we need to give the path"
12121212
]
12131213
},
12141214
{
@@ -3135,8 +3135,10 @@
31353135
"from sklearn.decomposition import PCA\n",
31363136
"from sklearn.manifold import TSNE\n",
31373137
"\n",
3138-
"num_clusters = 10\n",
3139-
"num_seeds = 10\n",
3138+
"groups = 10\n",
3139+
"\n",
3140+
"num_clusters = groups\n",
3141+
"num_seeds = groups\n",
31403142
"max_iterations = 300\n",
31413143
"labels_color_map = {\n",
31423144
" 0: '#20b2aa', 1: '#ff7373', 2: '#ffe4e1', 3: '#005073', 4: '#4d0404',\n",
@@ -3219,7 +3221,17 @@
32193221
"metadata": {},
32203222
"outputs": [],
32213223
"source": [
3222-
"for i in range(10):\n",
3224+
"for i in range(len(title_groups)):\n",
3225+
" data.loc[i,'Group'] = title_groups[i][0]"
3226+
]
3227+
},
3228+
{
3229+
"cell_type": "code",
3230+
"execution_count": null,
3231+
"metadata": {},
3232+
"outputs": [],
3233+
"source": [
3234+
"for i in range(groups):\n",
32233235
" print(\"\")\n",
32243236
" print(\"#### {} ###\".format(i))\n",
32253237
" print(\"\")\n",
@@ -3309,7 +3321,7 @@
33093321
"name": "python",
33103322
"nbconvert_exporter": "python",
33113323
"pygments_lexer": "ipython3",
3312-
"version": "3.8.3"
3324+
"version": "3.6.7"
33133325
},
33143326
"nav_menu": {},
33153327
"toc": {
@@ -3323,5 +3335,5 @@
33233335
}
33243336
},
33253337
"nbformat": 4,
3326-
"nbformat_minor": 2
3338+
"nbformat_minor": 4
33273339
}

0 commit comments

Comments
 (0)