Skip to content

Instantly share code, notes, and snippets.

@AlbericC
Last active November 7, 2015 14:06
Show Gist options
  • Save AlbericC/c66dc9e05441846e392a to your computer and use it in GitHub Desktop.
Save AlbericC/c66dc9e05441846e392a to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"from itertools import product\n",
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"from random import randint\n",
"%matplotlib inline"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAARUAAAEACAYAAACd9eLKAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJztfV2sJMd13nfuzL1LybLJEEaWXHKBJRwS0QZJbNomaSeG\nNglDM4ZD6omkABmETeSFTiwniK1dP0TQiyAJ8O8D8+PIyloxmWxkgyABWeGK8UUcyDYlk1YoLtfk\nWl6YS2aXjhhLlkHu3nu38tDdMzU19XOq6lR3z536gEF3VZ36mbnT3/3OOdU9pJRCRUVFhRQ2hl5A\nRUXF/kIllYqKClFUUqmoqBBFJZWKigpRVFKpqKgQRSWViooKUfRKKkR0LxGdJaJXiejDfc5dUVHR\nD6ivfSpENAHwxwDuBvA6gC8B+IBS6uVeFlBRUdEL+lQqdwA4p5Q6r5TaAfBfANzf4/wVFRU9oE9S\nuQnAa1r5QltXUVGxj9AnqdT7ASoq1gDTHud6HcBhrXwYjVqZgYgq8VRUDASlFEmM0yepfBnArUR0\nBMAbAB4E8IFls4/0uCQJbAM4NvAaYrCN1VovUG7NmwXGBIBnAfyjQmNLQr/8jxcZtSiUUrtE9M8B\n/HcAEwCfqpmfijl8F/hGoH2s6PN/dgrKfKa9vmul1G8D+O0+56wohVW7yPv8qm945hvic+uX3MZO\npSuAI0MvIBJHPG1jJYpb2uNQX9fYz+W2h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B/BXa+8lm\nCxrZmonouwD8NBolcAjAe4jogwsLGtmalyYPry8ZYyCV1wEc1sqHsciOg4KINtEQymeUUt2enEtE\ndEPbfiOAN9t6873c3Nb1hR8EcB8R/SmAJwD8QyL6zIjXCzR/6wtKqS+15c+iIZmLI17z9wH4olLq\n60qpXQC/hcaNH/OagbjvwYW2/majPrjuMZDKl9HcuXyEiLbQ3On81MBrAgC0d1l/CsAZpdQvaU3d\nBkBgeQPgQ0S0RUS3oN0A2Nd6lVI/p5Q6rJS6BY3/+z+UUj821vW2a74I4DUiuq2tuhvNXZpPY6Rr\nRhObuIuI3tV+R+5Gsz9rzGvu1sFeX/u3+WabjSM0G1efNAddQp8BLk9A6Z+gCXydA3Bi6PVo6/r7\naGITfwTghfZ1L5pA3RcAvALgGQDXaX1+rn0fZwH88IBrfx/m2Z9RrxfA3wXwJQBfQfNf/9oVWPPP\noiG/F9FkrzbHtGY0SvUNNHcJvQbgx1PWB+B72/d4DsCvcOaum98qKipEMQb3p6KiYh+hkkpFRYUo\nKqlUVFSIopJKRUWFKCqpVFRUiKKSSkVFhSgqqVRUVIiikkpFRYUo/j81probuWzzCQAAAABJRU5E\nrkJggg==\n",
"text/plain": [
"<matplotlib.figure.Figure at 0x7f067291bd30>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"a = np.array([i*j*j for i,j in product(range(1000),range(1000))])\n",
"_ = a.resize(1000,1000)\n",
"_ = plt.imshow(a,interpolation='none')"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAPYAAAD7CAYAAABZjGkWAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAADAVJREFUeJzt3U+M3Gd5wPHvw9pJ7IYYIqsNmzhdx0msJCWFlQlWKNUW\nuaoVhXBopSQCUXHgVCBwQBAuVQ69REIQCXEISZEiQkNrECISaQSFpa2oaEycQGzHj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2IZyLiI5OeqR8RMRMRRyLi0UnP0o+IeENEHIqI\n4xFxLCL2T3qmXiLi7u6fix9HxJcjouXbpgMZS9gRMQN8DjgIXA/cGRHXjeNzD+Ec8LHMvAHYD/zN\nJpgZ4C7gGLBZ3jy5D/hmZl4H3Agcn/A864qIOeCDwHxmvhmYAe6Y5EyrGdcZ+ybgVGa+kJnngEeA\n94zpcw8kM89m5lPd+7+m8weuv+9vTEhEXAHcAjwArHindNpExA7gnZn59wCZeT4zX57wWL38is5f\n+tsjYgud752+ONmRVhpX2JcDp5d9fKb72KbQ/Vv6rUCjH/M4Mp8BPg78ZtKD9Gk38POI+GJEPBkR\nX4iI/i8ymIDMfAn4NPBTYAn4ZWZ+e7JTrTSusDfLy8IVIuJi4BBwV/fMPZUi4lbgZ5l5hE1wtu7a\nAswDn8/MeeAV4JOTHWl9EbEH+CgwR+cV3MUR8d6JDrWKcYX9IrBr2ce76Jy1p1pEbAW+CnwpM78+\n6Xl6uBm4LSJ+AvwD8K6IeGjCM/VyBjiTmU90Pz5EJ/Rptg/4fmb+IjPPA1+j8/9+qowr7MPANREx\nFxEXALfT7MeMj0ZEBPAgcCwzPzvpeXrJzE9l5q7M3E3nzZzvZOb7Jz3XejLzLHA6Iq7tPnQAODrB\nkfrxLLA/IrZ1/4wcoPNm5VQZybXivWTm+Yj4EPA4nXcRH8zMqX73E3gH8D7gRxFxpPvY3Zn5zxOc\naSM2y5c/HwYe7v6F/zzwgQnPs67MfLr7SugwnfcyngTun+xUK3lJqVSQV55JBRm2VJBhSwUZtlSQ\nYUsFGbZUkGFLBRm2VND/A9joICiSdsywAAAAAElFTkSuQmCC\n",
"text/plain": [
"<matplotlib.figure.Figure at 0x7f067292f860>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"def thumbplot(array,height,width):\n",
" \"\"\"plots a w*h thumnbnail of array\"\"\"\n",
" thumb = np.zeros((height,width))\n",
" h_a, w_a = array.shape\n",
" pixh, pixw = h_a // height, w_a // width\n",
" for l, c in product(range(height), range(width)):\n",
" thumb[l,c] = array[pixh*l:pixh*(l+1), \n",
" pixw*c:pixh*(c+1)].mean()\n",
" plt.imshow(thumb,interpolation='none')\n",
"\n",
"thumbplot(a,10,10)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.5.0"
}
},
"nbformat": 4,
"nbformat_minor": 0
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment