comment

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です

関連記事

no image

matplotlib で、凡例を表示する位置を変更する方法

凡例(legend)の表示位置を変更するには、axis の legend の loc を設定する。 次のリンクhttps://matplotlib.org/stable/api/_as_gen/mat …

no image

tex で数式モード内に普通の文字列を入力する方法

\textrm を使う。 例 $$y = f (x) \hspace{1cm} \textrm{This is a function.}$$ 結果

no image

matplotlib で、ヒストグラムを作成する方法

ヒストグラムを描くには、data_hist を使う。 ヒストグラムの縦棒の数は bins で指定する。 例 from matplotlib import pyplot as plt data_hist …

no image

std::vector で、vector の始まりに要素を挿入する

vector に要素を追加するために、emplace を使うことができる。 emplace_back は、vector の末尾に要素を追加する。 例 #include <iostream> #i …

no image

python3 で辞書からランダムに要素を選択する方法

items() で辞書から要素を取り出し、random.choice でランダムに要素を選択する。 例 import random # 県庁所在地 mydict = {‘宮城県’:’仙台市’,’茨城県 …