mirror of
https://github.com/gsi-upm/sitc
synced 2024-11-22 06:22:29 +00:00
Added spaces
This commit is contained in:
parent
68f405d91d
commit
31153f8e5d
@ -444,11 +444,11 @@
|
|||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"source": [
|
||||||
"def substrings_in_string(big_string, substrings):\n",
|
"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",
|
" if big_string.find(substring) != 1:\n",
|
||||||
" return substring\n",
|
" return substring\n",
|
||||||
"print(big_string)\n",
|
" print(big_string)\n",
|
||||||
"return np.nan\n",
|
" return np.nan\n",
|
||||||
"#Turning cabin number into Deck\n",
|
"#Turning cabin number into Deck\n",
|
||||||
"cabin_list = ['A', 'B', 'C', 'D', 'E', 'F', 'T', 'G', 'Unknown']\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))"
|
"df['Deck']=df['Cabin'].map(lambda x: substrings_in_string(x, cabin_list))"
|
||||||
|
Loading…
Reference in New Issue
Block a user