1
0
mirror of https://github.com/gsi-upm/sitc synced 2024-11-22 06:22:29 +00:00

Added spaces

This commit is contained in:
Carlos A. Iglesias 2016-04-12 16:43:51 +02:00
parent 68f405d91d
commit 31153f8e5d

View File

@ -444,11 +444,11 @@
"outputs": [],
"source": [
"def substrings_in_string(big_string, substrings):\n",
"for substring in 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",
" 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))"