mirror of
https://github.com/rasbt/python_reference.git
synced 2024-11-27 14:01:15 +00:00
comments
This commit is contained in:
parent
4edb98e53e
commit
3fccde15b1
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"name": "",
|
"name": "",
|
||||||
"signature": "sha256:5455ed1ab796c2d7a01bee46d8f4d18de1bbc93ba0257248aff18e7b73a05e0a"
|
"signature": "sha256:01adffebfb99d8e7a86af443b9d14ca7695efc917465ea85868cc42681d6e96b"
|
||||||
},
|
},
|
||||||
"nbformat": 3,
|
"nbformat": 3,
|
||||||
"nbformat_minor": 0,
|
"nbformat_minor": 0,
|
||||||
|
@ -576,7 +576,8 @@
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"collapsed": false,
|
"collapsed": false,
|
||||||
"input": [
|
"input": [
|
||||||
"# Create a new column\n",
|
"# Creating a new column\n",
|
||||||
|
"\n",
|
||||||
"df['team'] = pd.Series('', index=df.index)\n",
|
"df['team'] = pd.Series('', index=df.index)\n",
|
||||||
"df.tail(3)"
|
"df.tail(3)"
|
||||||
],
|
],
|
||||||
|
@ -664,7 +665,7 @@
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"collapsed": false,
|
"collapsed": false,
|
||||||
"input": [
|
"input": [
|
||||||
"# process salary column\n",
|
"# Processing `salary` column\n",
|
||||||
"\n",
|
"\n",
|
||||||
"df['salary'] = df['salary'].apply(lambda x: x.strip('$m'))\n",
|
"df['salary'] = df['salary'].apply(lambda x: x.strip('$m'))\n",
|
||||||
"df.tail()"
|
"df.tail()"
|
||||||
|
@ -781,7 +782,7 @@
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"collapsed": false,
|
"collapsed": false,
|
||||||
"input": [
|
"input": [
|
||||||
"# process `player` column\n",
|
"# Processing `player` column\n",
|
||||||
"\n",
|
"\n",
|
||||||
"def process_player_col(text):\n",
|
"def process_player_col(text):\n",
|
||||||
" name, rest = text.split('\\n')\n",
|
" name, rest = text.split('\\n')\n",
|
||||||
|
|
Loading…
Reference in New Issue
Block a user