From aca6494baa6d7b336ebef6b22cf1d20a226144cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emek=20Tayda=C5=9F?= Date: Sun, 7 Jul 2024 15:55:07 +0300 Subject: [PATCH] Change str.replace() regex to start with r and set regex=True --- .../pandas-exercises-solutions.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/section-2-data-science-and-ml-tools/pandas-exercises-solutions.ipynb b/section-2-data-science-and-ml-tools/pandas-exercises-solutions.ipynb index bb76c38ae..40aa95220 100644 --- a/section-2-data-science-and-ml-tools/pandas-exercises-solutions.ipynb +++ b/section-2-data-science-and-ml-tools/pandas-exercises-solutions.ipynb @@ -1322,7 +1322,7 @@ "outputs": [], "source": [ "# Remove the punctuation from price column\n", - "car_sales[\"Price\"] = car_sales[\"Price\"].str.replace(\"[\\$\\,\\.]\", \"\")" + "car_sales[\"Price\"] = car_sales[\"Price\"].str.replace(r\"[\\$\\,\\.]\", \"\", regex=True)" ] }, {