Skip to content

Commit

Permalink
Update fake_news_cleaning.ipynb
Browse files Browse the repository at this point in the history
  • Loading branch information
khadra1 committed Aug 18, 2022
1 parent 344ac6c commit c66209f
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions fake_news_cleaning.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -642,12 +642,12 @@
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": 45,
"metadata": {},
"outputs": [],
"source": [
"import re\n",
"URLS = r'(https://)'\n",
"URLS = r'(https?://\\S+)'\n",
"true_copy = true_df\n",
"fake_copy = fake_df\n",
"true_copy['urlcount'] = true_df.text.apply(lambda x: re.findall(URLS, x)).str.len()\n",
Expand All @@ -656,7 +656,7 @@
},
{
"cell_type": "code",
"execution_count": 30,
"execution_count": 46,
"metadata": {},
"outputs": [
{
Expand All @@ -666,7 +666,7 @@
"Name: urlcount, dtype: int64"
]
},
"execution_count": 30,
"execution_count": 46,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -677,7 +677,7 @@
},
{
"cell_type": "code",
"execution_count": 33,
"execution_count": 47,
"metadata": {},
"outputs": [
{
Expand All @@ -686,7 +686,7 @@
"3299"
]
},
"execution_count": 33,
"execution_count": 47,
"metadata": {},
"output_type": "execute_result"
}
Expand Down Expand Up @@ -883,12 +883,12 @@
},
{
"cell_type": "code",
"execution_count": 17,
"execution_count": 48,
"metadata": {},
"outputs": [],
"source": [
"import re\n",
"URLS = r'(https://)'\n",
"URLS = r'(https?://\\S+)'\n",
"true_copy2 = true_df.copy()\n",
"fake_copy2 = fake_df.copy()\n",
"true_copy2['urlcount'] = true_copy2['date'].apply(lambda x: re.findall(URLS, x)).str.len()\n",
Expand All @@ -897,7 +897,7 @@
},
{
"cell_type": "code",
"execution_count": 18,
"execution_count": 49,
"metadata": {},
"outputs": [
{
Expand All @@ -906,7 +906,7 @@
"9"
]
},
"execution_count": 18,
"execution_count": 49,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -917,7 +917,7 @@
},
{
"cell_type": "code",
"execution_count": 19,
"execution_count": 50,
"metadata": {},
"outputs": [
{
Expand All @@ -931,7 +931,7 @@
"Name: 21870, dtype: object"
]
},
"execution_count": 19,
"execution_count": 50,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -942,7 +942,7 @@
},
{
"cell_type": "code",
"execution_count": 20,
"execution_count": 51,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -1085,7 +1085,7 @@
"21870 https://fedup.wpengine.com/wp-content/uploads/... 1 "
]
},
"execution_count": 20,
"execution_count": 51,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -1096,7 +1096,7 @@
},
{
"cell_type": "code",
"execution_count": 21,
"execution_count": 52,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -1264,7 +1264,7 @@
"[23481 rows x 5 columns]"
]
},
"execution_count": 21,
"execution_count": 52,
"metadata": {},
"output_type": "execute_result"
}
Expand Down

0 comments on commit c66209f

Please sign in to comment.