comment

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

関連記事

no image

python3 で、ファイルの文字列の1行目を出力する

ファイルを読み込んで、1行目だけをコンソールに出力するには readlines() を使う。 例 f = open(“data.txt”) lines = f.readlines() print(li …

no image

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

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

no image

c++ で文字列を「区切り文字」を使って分ける方法

string の find を使って、区切り文字の場所を取得し、その位置で区切る。 例 #include <iostream> #include <string> using namesp …

no image

tex でギリシャ文字のベータ(β)を入力する方法

ベータ(β)は、ギリシャ文字の2番目の文字。数学等でよく使われる。 例 $\beta$ 結果

no image

matplotlib で、2種類のデータをプロットする方法

下では、凡例(legend)を設定している。 例 from matplotlib import pyplot as plt data_x = [25,26,27] data_y = [ …