dedup tags

This commit is contained in:
wassname
2025-01-07 10:15:00 +08:00
parent 847594ae14
commit e42268c63a
2 changed files with 15 additions and 14 deletions
+1 -1
View File
File diff suppressed because one or more lines are too long
+14 -13
View File
@@ -9,7 +9,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
@@ -19,7 +19,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 9,
"metadata": {},
"outputs": [
{
@@ -491,7 +491,7 @@
"[13412 rows x 24 columns]"
]
},
"execution_count": 3,
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
@@ -515,7 +515,7 @@
},
{
"cell_type": "code",
"execution_count": 41,
"execution_count": 10,
"metadata": {},
"outputs": [],
"source": [
@@ -529,9 +529,10 @@
"d[\"url\"] = d[\"url\"].apply(lambda x: collapsibe('...', urls2a(x)))\n",
"d[\"score\"] = d[\"score\"].round(2)\n",
"\n",
"d['tags'] = d['tags'].apply(lambda x: \", \".join(x))\n",
"d['reviews_quotes'] = d['reviews_quotes'].apply(lambda x: \"- \" + \"<br> - \".join(x))\n",
"d['if_you_liked_x_you_will_like_this'] = d['if_you_liked_x_you_will_like_this'].apply(lambda x: \", \".join(x))\n",
"# TODO unique\n",
"d['tags'] = d['tags'].apply(lambda x: \", \".join(unique_elements(x)))\n",
"d['reviews_quotes'] = d['reviews_quotes'].apply(lambda x: \"- \" + \"<br> - \".join(unique_elements(x)))\n",
"d['if_you_liked_x_you_will_like_this'] = d['if_you_liked_x_you_will_like_this'].apply(lambda x: \", \".join(unique_elements(x)))\n",
"\n",
"# prefix = 'https://reddit.com/r/rational/comments/'\n",
"prefix = 'https://reddit.com'\n",
@@ -548,7 +549,7 @@
},
{
"cell_type": "code",
"execution_count": 42,
"execution_count": 11,
"metadata": {},
"outputs": [
{
@@ -578,7 +579,7 @@
},
{
"cell_type": "code",
"execution_count": 43,
"execution_count": 12,
"metadata": {},
"outputs": [
{
@@ -635,7 +636,7 @@
},
{
"cell_type": "code",
"execution_count": 44,
"execution_count": 13,
"metadata": {},
"outputs": [],
"source": [
@@ -687,7 +688,7 @@
},
{
"cell_type": "code",
"execution_count": 45,
"execution_count": 14,
"metadata": {},
"outputs": [
{
@@ -1151,7 +1152,7 @@
"[13412 rows x 24 columns]"
]
},
"execution_count": 45,
"execution_count": 14,
"metadata": {},
"output_type": "execute_result"
}
@@ -1163,7 +1164,7 @@
},
{
"cell_type": "code",
"execution_count": 46,
"execution_count": 15,
"metadata": {},
"outputs": [
{