numpy

matplotlib pcolor

matplotlib の pcolor %matplotlib inline import matplotlib.pyplot as plt import numpy as np #from matplotlib.colors import LogNorm #Z = np.random.rand(6, 10) Z = 100*np.random.randn(64,256) Z = np.where(Z < -256, -256, Z) Z = np.where(Z > 2…

matplotlib の hist

データをプロットして、ヒストを作って、確認する いつものように、乱数でデータを作って、プロットとヒストとその結果を表示してみる import matplotlib.pyplot as plt import numpy as np def print_bins(n,bins): tmp = 'hist data:\n' if len(n) != len(…

Pandas 集中講座 その6 時系列、カテゴリ、プロット、データ入出力

Pandasライブラリを覚えたい!公式「10 Minutes to pandas」をモチーフに使って実際に動作させ学習する。第6回 時系列、カテゴリ、プロット、データ入出力 Pandas 集中講座(6) Pandas 集中講座 その1 - chiyoh’s blog Pandas 集中講座 その2 - chiyoh’s …

Pandas 集中講座 その5 グループ、再構成

Pandasライブラリを覚えたい!公式「10 Minutes to pandas」をモチーフに使って実際に動作させ学習する。第5回 グループ、再構成 Pandas 集中講座(5) Pandas 集中講座 その1 - chiyoh’s blog Pandas 集中講座 その2 - chiyoh’s blog Pandas 集中講座 そ…

Pandas 集中講座 その4 マージ(結合)

Pandasライブラリを覚えたい!公式「10 Minutes to pandas」をモチーフに使って実際に動作させ学習する。第4回 マージ(結合) Pandas 集中講座(4) Pandas 集中講座 その1 - chiyoh’s blog Pandas 集中講座 その2 - chiyoh’s blog Pandas 集中講座 その3 …

Pandas 集中講座 その3 欠陥データと操作

Pandasライブラリを覚えたい!公式「10 Minutes to pandas」をモチーフに使って実際に動作させ学習する。第3回 欠陥データと操作 Pandas 集中講座(3) Pandas 集中講座 その1 - chiyoh’s blog Pandas 集中講座 その2 - chiyoh’s blog Pandas 集中講座 そ…

Pandas 集中講座 その2 選択

Pandasライブラリを覚えたい!公式「10 Minutes to pandas」をモチーフに使って実際に動作させ学習する。第2回 選択 Pandas 集中講座(2) Pandas 集中講座 その1 - chiyoh’s blog Pandas 集中講座 その2 - chiyoh’s blog Pandas 集中講座 その3 - chiyoh…

Pandas 集中講座 その1 オブジェクト作成とデータ参照

Pandasライブラリを覚えたい!公式「10 Minutes to pandas」をモチーフに使って実際に動作させ学習する。第1回 オブジェクト作成とデータ参照 Pandas 集中講座(1) Pandas 集中講座 その1 オブジェクト作成とデータ参照 - chiyoh’s blog Pandas 集中講座 …

Pandas のSeriesとDataFrame

Pandas(データ構造) Pandasのデータ構造はどうなっているのか? * Series(ラベル付きデータ) * DataFrame(ラベル付きデータが複数) です。 Series (シリーズ) 直列、連続など、繋がりのある何かの事ですね。Pandasは、スプレッドシート(表計算)と思っていた…

Matplotlib 3Dプロット、meshgrid とは?

3Dプロット(mplot3d) 、 meshgrid とは? 始め何やっているのかわからなかったので、どうしてそうなっているのか羅列していきます こんな感じのプロットはどのように描かれているのか? 次の式に従って描かれたのが上の図です では、上から眺めたらどうなる…

うちのマシンは、int64じゃない!?

numpyのデータタイプ これから、Numpyを使っていろいろと演算等を行うにあたって自分が何をやっているのか知っておく必要がある つまり、π(パイ)はいくつなんだ?という話なのである。(実際は、いくつとしてデータに記録されるのかという話) 事の始まり impo…

PIL(pillow)画像をnumpyにしたり戻したり

画像オブジェクトをnumpy配列に変換 import numpy as np from PIL import Image im = Image.open('sample20x15.bmp') im im_paltte = im.quantize() # パレットカラー 1chカラー im_CMYK = im.convert('CMYK') # CMYK 4chカラー im_grey = im.convert('L') #…