Update analysis_notebook_hashtag.ipynb
Fix of date time transformation for date specific filtering.
This commit is contained in:
@@ -89,7 +89,7 @@
|
|||||||
"source": [
|
"source": [
|
||||||
"# Changes 'created_at' to data format datetime64[ns, tzlocal()]\n",
|
"# Changes 'created_at' to data format datetime64[ns, tzlocal()]\n",
|
||||||
"# That is necessary for date specific filtering\n",
|
"# That is necessary for date specific filtering\n",
|
||||||
"df['created_at'] = pd.to_datetime(df['created_at'], utc=True)\n",
|
"df['created_at'] = pd.to_datetime(df['created_at'], errors='coerce', utc=True)\n",
|
||||||
"\n",
|
"\n",
|
||||||
"# Adding the column 'instance' by extracting the domain name (and suffix) from the column 'url' of the post\n",
|
"# Adding the column 'instance' by extracting the domain name (and suffix) from the column 'url' of the post\n",
|
||||||
"df['instance'] = df['url'].apply(lambda x: urlparse(x)[1])"
|
"df['instance'] = df['url'].apply(lambda x: urlparse(x)[1])"
|
||||||
|
|||||||
Reference in New Issue
Block a user