新卒1年目の技術に関する備忘録

自主学習で困ったこと、学んだことをまとめています

2018-12-01から1日間の記事一覧

map()の使い方②

>>> x = pd.Series([1,2,3], index=['one', 'two', 'three']) >>> x one 1 two 2 three 3 dtype: int64 >>> z = {1: 'A', 2: 'B', 3: 'C'} >>> x.map(z) one A two B three C 公式ドキュメントから map()で引数に辞書型をとると、そのキーの紐づく値に変わる…

map()の使い方①

①map(function, functionに入れたいもの) 例 array = np.arange(10) array array array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]) list(map(lambda x: x*x, array [0, 1, 4, 9, 16, 25, 36, 49, 64, 81]​

jupyter notebookの入力補完

入力補完はnbextentionsをインストールすれば良い。 anacondaの場合 conda install -y -c conda-forge jupyter_contrib_nbextensions というコードをターミナルで打ち込む。 その後、jupyter notebookのHOMEにあるNbextensionsからHinterlandを有効にする。