Skip to content

Instantly share code, notes, and snippets.

@xyos
Created November 30, 2014 17:11
Show Gist options
  • Save xyos/a30d2bbb478cac919f21 to your computer and use it in GitHub Desktop.
Save xyos/a30d2bbb478cac919f21 to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
{
"metadata": {
"name": "Untitled0"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "code",
"collapsed": false,
"input": "import numpy as np",
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 1
},
{
"cell_type": "code",
"collapsed": false,
"input": "y = np.arange(27).reshape(3,3,3)\ny",
"language": "python",
"metadata": {},
"outputs": [
{
"metadata": {},
"output_type": "pyout",
"prompt_number": 2,
"text": "array([[[ 0, 1, 2],\n [ 3, 4, 5],\n [ 6, 7, 8]],\n\n [[ 9, 10, 11],\n [12, 13, 14],\n [15, 16, 17]],\n\n [[18, 19, 20],\n [21, 22, 23],\n [24, 25, 26]]])"
}
],
"prompt_number": 2
},
{
"cell_type": "code",
"collapsed": false,
"input": "y[0,0,0]",
"language": "python",
"metadata": {},
"outputs": [
{
"metadata": {},
"output_type": "pyout",
"prompt_number": 3,
"text": "0"
}
],
"prompt_number": 3
},
{
"cell_type": "code",
"collapsed": false,
"input": "y[2,2,2]",
"language": "python",
"metadata": {},
"outputs": [
{
"metadata": {},
"output_type": "pyout",
"prompt_number": 4,
"text": "26"
}
],
"prompt_number": 4
},
{
"cell_type": "code",
"collapsed": false,
"input": "y[0:1,:,:]",
"language": "python",
"metadata": {},
"outputs": [
{
"metadata": {},
"output_type": "pyout",
"prompt_number": 5,
"text": "array([[[0, 1, 2],\n [3, 4, 5],\n [6, 7, 8]]])"
}
],
"prompt_number": 5
},
{
"cell_type": "code",
"collapsed": false,
"input": "",
"language": "python",
"metadata": {},
"outputs": []
}
],
"metadata": {}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment