Skip to content

Instantly share code, notes, and snippets.

  • to plot grayscale image data, it's nice to code
# image_data.shape must be (a, b)
plt.imshow(image_data, cmap=matplotlib.cm.binary, interpolation="nearest")
plt.show()

binary color map: matplotlib.cm.binary

  • to concatenate tuples
@watermouth
watermouth / how_to_use_shift_function.ipynb
Created January 26, 2018 12:01
an_example_on_scipy_shift_function
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@watermouth
watermouth / memos_on_Jupyter-notebook.md
Last active January 28, 2018 02:38
memos on Jupyter-notebook
  • importing .py files from jupyter-notebooks and editting the py files, it's nice to code
%reload_ext autoreload
%autoreload 2
  • to plot on jupyter-notebook, it's nice to code
@watermouth
watermouth / gist:5729993
Created June 7, 2013 15:13
performance check key-value pair access using - direct array - array through key array and match function - Hashtbl
type currency_t = JPY | USD | EUR | AUD | GBP
let to_int ccy = match ccy with
| JPY -> 0
| USD -> 1
| EUR -> 2
| AUD -> 3
| GBP -> 4
let currencies = [|JPY;USD;EUR;AUD;GBP|]
@watermouth
watermouth / gist:4418360
Created December 31, 2012 08:52
Installing GSL in Mac OS X (version 10.7.5 ) の記録
GSL - GNU Scientific Library - GNU Project - Free Software Foundation (FSF)
ライブラリの使用方法についてはmanual
http://www.gnu.org/software/gsl/manual/html_node/
を参照する.
以下の通りに, 最終的には動作確認することができた.
0. ダウンロード
http://core.ring.gr.jp/pub/GNU/gsl/
バージョンの一番新しいものをとる. .sigは無視.