From c14d637b2f005c8968b20022fc594817ee8d2a74 Mon Sep 17 00:00:00 2001 From: Almex <145460209+Almex-codes@users.noreply.github.com> Date: Thu, 12 Sep 2024 09:48:05 +0200 Subject: [PATCH] Update analysis_notebook_hashtag.ipynb Fix of date time transformation for date specific filtering. --- analysis_notebook_hashtag.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/analysis_notebook_hashtag.ipynb b/analysis_notebook_hashtag.ipynb index 4777b28..39814b4 100644 --- a/analysis_notebook_hashtag.ipynb +++ b/analysis_notebook_hashtag.ipynb @@ -89,7 +89,7 @@ "source": [ "# Changes 'created_at' to data format datetime64[ns, tzlocal()]\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", "# 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])"