This commit is contained in:
rasbt 2014-07-31 00:20:22 -04:00
parent 683f8a50f6
commit 447f588960
2 changed files with 38 additions and 35 deletions

3
tutorials/example.csv Normal file
View File

@ -0,0 +1,3 @@
1,2,3,4
5,6,,8
10,11,12,
1 1 2 3 4
2 5 6 8
3 10 11 12

View File

@ -1,7 +1,7 @@
{ {
"metadata": { "metadata": {
"name": "", "name": "",
"signature": "sha256:7553ded8e8dc9e6faf09cd22747b33a3ae9039743491e88025fb61ea45203063" "signature": "sha256:b2597ea4263c11dd6774b227e7a3a5626197c4863e6895002657fd55d02b55d9"
}, },
"nbformat": 3, "nbformat": 3,
"nbformat_minor": 0, "nbformat_minor": 0,
@ -39,10 +39,10 @@
"output_type": "stream", "output_type": "stream",
"stream": "stdout", "stream": "stdout",
"text": [ "text": [
"Last updated: 30/07/2014 \n", "Last updated: 31/07/2014 \n",
"\n", "\n",
"CPython 3.4.1\n", "CPython 3.4.1\n",
"IPython 2.0.0\n", "IPython 2.1.0\n",
"\n", "\n",
"numpy 1.8.1\n" "numpy 1.8.1\n"
] ]
@ -161,7 +161,7 @@
"output_type": "stream", "output_type": "stream",
"stream": "stdout", "stream": "stdout",
"text": [ "text": [
"Overwriting example.csv\n" "Writing example.csv\n"
] ]
} }
], ],
@ -258,13 +258,13 @@
{ {
"metadata": {}, "metadata": {},
"output_type": "pyout", "output_type": "pyout",
"prompt_number": 37, "prompt_number": 5,
"text": [ "text": [
"True" "True"
] ]
} }
], ],
"prompt_number": 37 "prompt_number": 5
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
@ -292,7 +292,7 @@
{ {
"metadata": {}, "metadata": {},
"output_type": "pyout", "output_type": "pyout",
"prompt_number": 5, "prompt_number": 6,
"text": [ "text": [
"array([[False, False, False, False],\n", "array([[False, False, False, False],\n",
" [False, False, True, False],\n", " [False, False, True, False],\n",
@ -300,7 +300,7 @@
] ]
} }
], ],
"prompt_number": 5 "prompt_number": 6
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
@ -351,13 +351,13 @@
{ {
"metadata": {}, "metadata": {},
"output_type": "pyout", "output_type": "pyout",
"prompt_number": 8, "prompt_number": 7,
"text": [ "text": [
"2" "2"
] ]
} }
], ],
"prompt_number": 8 "prompt_number": 7
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
@ -385,13 +385,13 @@
{ {
"metadata": {}, "metadata": {},
"output_type": "pyout", "output_type": "pyout",
"prompt_number": 9, "prompt_number": 8,
"text": [ "text": [
"10" "10"
] ]
} }
], ],
"prompt_number": 9 "prompt_number": 8
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
@ -435,13 +435,13 @@
{ {
"metadata": {}, "metadata": {},
"output_type": "pyout", "output_type": "pyout",
"prompt_number": 10, "prompt_number": 9,
"text": [ "text": [
"nan" "nan"
] ]
} }
], ],
"prompt_number": 10 "prompt_number": 9
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
@ -474,13 +474,32 @@
] ]
} }
], ],
"prompt_number": 10
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"print('column sums:', np.nansum(ary, axis=0))"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"column sums: [ 16. 19. 15. 12.]\n"
]
}
],
"prompt_number": 11 "prompt_number": 11
}, },
{ {
"cell_type": "code", "cell_type": "code",
"collapsed": false, "collapsed": false,
"input": [ "input": [
"print('row sums:', np.nansum(ary, axis=0))" "print('row sums:', np.nansum(ary, axis=1))"
], ],
"language": "python", "language": "python",
"metadata": {}, "metadata": {},
@ -489,31 +508,12 @@
"output_type": "stream", "output_type": "stream",
"stream": "stdout", "stream": "stdout",
"text": [ "text": [
"row sums: [ 16. 19. 15. 12.]\n" "row sums: [ 10. 19. 33.]\n"
] ]
} }
], ],
"prompt_number": 12 "prompt_number": 12
}, },
{
"cell_type": "code",
"collapsed": false,
"input": [
"print('column sums:', np.nansum(ary, axis=1))"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"column sums: [ 10. 19. 33.]\n"
]
}
],
"prompt_number": 13
},
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": {}, "metadata": {},