From 31153f8e5d02d7c06f727d4298aad2a617466256 Mon Sep 17 00:00:00 2001 From: "Carlos A. Iglesias" Date: Tue, 12 Apr 2016 16:43:51 +0200 Subject: [PATCH] Added spaces --- ml2/3_5_Exercise_1.ipynb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ml2/3_5_Exercise_1.ipynb b/ml2/3_5_Exercise_1.ipynb index f6f8484..76920c7 100644 --- a/ml2/3_5_Exercise_1.ipynb +++ b/ml2/3_5_Exercise_1.ipynb @@ -444,11 +444,11 @@ "outputs": [], "source": [ "def substrings_in_string(big_string, substrings):\n", - "for substring in substrings:\n", - " if big_string.find(substring) != 1:\n", - " return substring\n", - "print(big_string)\n", - "return np.nan\n", + " for substring in substrings:\n", + " if big_string.find(substring) != 1:\n", + " return substring\n", + " print(big_string)\n", + " return np.nan\n", "#Turning cabin number into Deck\n", "cabin_list = ['A', 'B', 'C', 'D', 'E', 'F', 'T', 'G', 'Unknown']\n", "df['Deck']=df['Cabin'].map(lambda x: substrings_in_string(x, cabin_list))"